Skip to content

Instantly share code, notes, and snippets.

@peteonrails
Created February 25, 2014 04:04
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 peteonrails/9202498 to your computer and use it in GitHub Desktop.
Save peteonrails/9202498 to your computer and use it in GitHub Desktop.
A rose by any other name: Classes are just variables
irb(main):001:0> Function = Proc
=> Proc
irb(main):002:0> Function
=> Proc
irb(main):003:0> f = Function.new { puts "I am a function " }
#<Proc:0x007f14ab5d13c8@(irb):11>
irb(main):004:0> f.call
I am a function
=> nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment