Last active
August 29, 2015 13:55
-
-
Save stujo/8744415 to your computer and use it in GitHub Desktop.
This file contains 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
#Declaring a new Hash instance | |
creditcard = { | |
"name" => "Billy Bob", | |
"number" => "4444333322221111", | |
"code" => "555", | |
"expiry" => "07/2016" | |
} | |
#How about adding new key value pairs? | |
creditcard['exp_year']=2016 | |
creditcard['exp_month']=7 | |
#How about deleting values? | |
creditcard.delete "expiry" | |
#What about JSON? | |
creditcard.to_json | |
require 'json' | |
creditcard.to_json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment