Skip to content

Instantly share code, notes, and snippets.

@nthj
Created December 10, 2013 18:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nthj/7895938 to your computer and use it in GitHub Desktop.
Save nthj/7895938 to your computer and use it in GitHub Desktop.
def bouncer(name, age = 18)
if age < 21
puts "Go away, #{name}"
else
puts "OK"
end
end
def hello(name, more = { })
attributes = {
:age => 21,
:city => 'San Diego, CA'
}
attributes.merge!(more)
puts "Name: #{name}"
attributes.each_pair do |k, v|
puts "#{k} :: #{v}"
end
end
hello "Nathaniel", :age => 28, :hair => 'brown'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment