I'm working with some serialized data from a MySQL database and I need to deserialize this using Ruby (the serialized data is used to build up a WHERE clause for a database query). PHP has the unserialize()
method which will convert it into an Array; what is the Ruby equivalent of this?
The data in question looks like this, if it helps any:
a:2:{s:5:"Lists";a:1:{i:0;s:2:"11";}s:5:"Rules";a:1:{i:0;a:3:{s:4:"type";s:5:"group";s:9:"connector";s:3:"and";s:5:"rules";a:1:{i:0;a:3:{s:4:"type";s:4:"rule";s:9:"connector";s:3:"and";s:5:"rules";a:3:{s:8:"ruleName";s:2:"21";s:12:"ruleOperator";s:10:"isnotempty";s:10:"ruleValues";a:1:{i:0;s:0:"";}}}}}}}