Skip to content

Instantly share code, notes, and snippets.

@rentalcustard
Created February 25, 2013 15:34
Show Gist options
  • Save rentalcustard/5030640 to your computer and use it in GitHub Desktop.
Save rentalcustard/5030640 to your computer and use it in GitHub Desktop.
What actually is `using`?

A search for 'using' on http://www.ruby-doc.org/core-2.0/index.html returns, well, nothing. So, what is it?

2.0.0p0 :001 > method(:using)
=> #<Method: main.using> 
2.0.0p0 :002 > _.source_location
=> nil

So it's some kind of method on main with no source location. Hmm. Well, the changelog mentions ri ruby:syntax. Let's try that.

~/code/200-test> ri ruby:syntax | cat
= Pages in ruby core

Right. OK. Let's have a look online.

http://www.ruby-doc.org/core-2.0/doc/syntax_rdoc.html

I still have no idea.

@durran
Copy link

durran commented Feb 25, 2013

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