Skip to content

Instantly share code, notes, and snippets.

@ryanckulp
Created January 1, 2018 22:53
Show Gist options
  • Save ryanckulp/d35abac2a8fdb2c80c7777e57654be20 to your computer and use it in GitHub Desktop.
Save ryanckulp/d35abac2a8fdb2c80c7777e57654be20 to your computer and use it in GitHub Desktop.
accessing a Hash key/value in Ruby
questions = {
'one' => "What's your name?",
'two' => "How old are you?"
}
questions['one'] # => returns "What's your name?"
questions['two'] # => returns "How old are you?"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment