Skip to content

Instantly share code, notes, and snippets.

@dohoonk
Last active February 19, 2016 20:17
Show Gist options
  • Select an option

  • Save dohoonk/a0f19f6906ccb3a3bcc7 to your computer and use it in GitHub Desktop.

Select an option

Save dohoonk/a0f19f6906ccb3a3bcc7 to your computer and use it in GitHub Desktop.
Bootcamp

Hash

me = {"Me" => "Tony"} key => Value (pairs)

me["Me"] me.fetch("Me","unkown") <---- second arguement is the default value to return

my_hash = Hash.new my_hash = Hash.new(0) my_hash = {}

my_hash.each do |key,value|
 puts "key is #{key} and values is #{value}"
 end

Symbol

:im_a_symbol

immutable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment