Ruby Serialization
q = {name: "binibin", age: 22, company: "braincommerce"}
=> {:name=>"binibin", :age=>22, :company=>"braincommerce"}
q.to_json
=> "{\"name\":\"binibin\",\"age\":22,\"company\":\"braincommerce\”}"
Ruby Deserialization
JSON.parse(q.to_json)
=> {"name"=>"binibin", "age"=>22, "company"=>"braincommerce"}
Javascript Deserialization
j = JSON.parse("{\"name\":\"binibin\",\"age\":22,\"company\":\"braincommerce\"}");
=> Object {name: "binibin", age: 22, company: "braincommerce"}
Javascript Serialization
JSON.stringify(j)
=> "{"name":"binibin","age":22,"company":"braincommerce"}"