Skip to content

Instantly share code, notes, and snippets.

@trotter
Created May 4, 2011 18:09
Show Gist options
  • Save trotter/955690 to your computer and use it in GitHub Desktop.
Save trotter/955690 to your computer and use it in GitHub Desktop.
This is how ruby does things
ruby-1.9.2-p180 :007 > def variables(stuff)
ruby-1.9.2-p180 :008?> puts stuff
ruby-1.9.2-p180 :009?> end
=> nil
ruby-1.9.2-p180 :010 > variables(:hi => "there")
{:hi=>"there"}
=> nil
ruby-1.9.2-p180 :011 > variables (:hi => "there")
SyntaxError: (irb):11: syntax error, unexpected tASSOC, expecting ')'
variables (:hi => "there")
^
(irb):11: syntax error, unexpected ')', expecting $end
from /Users/trotter/.rvm/rubies/ruby-1.9.2-p180/bin/irb:16:in `<main>'
ruby-1.9.2-p180 :012 > variables :hi => "there"
{:hi=>"there"}
=> nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment