Skip to content

Instantly share code, notes, and snippets.

@gtrak
Last active December 22, 2015 18:39
Show Gist options
  • Save gtrak/6514209 to your computer and use it in GitHub Desktop.
Save gtrak/6514209 to your computer and use it in GitHub Desktop.
a = ["first", "second", "third", "fourth"]
puts "#{a}"
puts a[0]
puts a[3]
b = {"key1" => "value1",
"key2" => "value2"}
puts "#{b}"
puts b['key1']
puts b['key2']
c = [{"nested-key" => "This is Nested Inside An Array"}]
puts c[0]['nested-key']
inner = c[0]
puts inner['nested-key']
;; prints (don't run this part)
["first", "second", "third", "fourth"]
first
fourth
{"key1"=>"value1", "key2"=>"value2"}
value1
value2
This is Nested Inside An Array
This is Nested Inside An Array
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment