Created
November 20, 2015 21:53
-
-
Save atomgiant/4d7ed71308c2ef20f00f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For a given Metafield, this is how | |
# you access the serialized JSON data | |
mf = {"id"=>10030144453, | |
"namespace"=>"product", | |
"key"=>"custom_attrs", | |
"value"=>"{\"width\":11.2,\"height\":35.7}", | |
"value_type"=>"string", | |
"description"=>nil, | |
"owner_id"=>1234567890, | |
"created_at"=>"2015-11-20T16:48:03-05:00", | |
"updated_at"=>"2015-11-20T16:48:03-05:00", | |
"owner_resource"=>"product"} | |
attrs = JSON.parse(mf["value"]) | |
=> {"width"=>11.2, "height"=>35.7} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment