Skip to content

Instantly share code, notes, and snippets.

@deependersingla
Created December 9, 2013 17:56
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 deependersingla/7876836 to your computer and use it in GitHub Desktop.
Save deependersingla/7876836 to your computer and use it in GitHub Desktop.
pry(main)> f = Foo::Bar.new
=> #<Foo::Bar:0x000000030204d8>
[3] pry(main)> $ f.[]
From: (pry) @ line 3:
Owner: Foo::Bar
Visibility: public
Number of lines: 3
def [](key)
"value"
end
[4] pry(main)> $ f[]
From: (pry) @ line 3:
Owner: Foo::Bar
Visibility: public
Number of lines: 3
def [](key)
"value"
end
Second test is not passing:
[5] pry(main)> $ Foo::Bar.new.[]
From: (pry) @ line 3:
Owner: Foo::Bar
Visibility: public
Number of lines: 3
def [](key)
"value"
end
[6] pry(main)> $ Foo::Bar.new[]
Error: Couldn't locate a definition for Foo::Bar.new[]!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment