Skip to content

Instantly share code, notes, and snippets.

@bkempner
Created October 21, 2011 19:38
Show Gist options
  • Save bkempner/1304733 to your computer and use it in GitHub Desktop.
Save bkempner/1304733 to your computer and use it in GitHub Desktop.
class Foo
def initialize(options)
@bar = options.fetch(:bar, nil)
@baz = options.fetch(:baz, nil)
end
end
def Foo(options)
Foo.new(options)
end
ruby-1.9.2-p290 :028 > f = Foo bar: 'chuck', baz: 'testa'
=> #<Foo:0x007ffdd407fec0 @foo="chuck", @bar="testa">
@sahilshah-rr
Copy link

Ahhh. That's an important catch. Cool!

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