Skip to content

Instantly share code, notes, and snippets.

@aberant
Created November 21, 2012 16:52
Show Gist options
  • Save aberant/4126008 to your computer and use it in GitHub Desktop.
Save aberant/4126008 to your computer and use it in GitHub Desktop.
method class example
# http://ruby-doc.org/core-1.9.3/Object.html#method-i-method
# http://ruby-doc.org/core-1.9.3/Method.html
> User.method(:first)
=> #<Method: Class(ActiveRecord::Querying)#first>
> User.method(:first).arity
=> -1
User.method(:first).source_location
=> ["/Users/aberant/.rvm/gems/ruby-1.9.2-p320/gems/activerecord-3.2.2/lib/active_record/querying.rb",
4]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment