Skip to content

Instantly share code, notes, and snippets.

@jrwren
Forked from trek/gist:638615
Created October 21, 2010 15:02
Show Gist options
  • Select an option

  • Save jrwren/638625 to your computer and use it in GitHub Desktop.

Select an option

Save jrwren/638625 to your computer and use it in GitHub Desktop.

Revisions

  1. jrwren revised this gist Oct 21, 2010. 1 changed file with 6 additions and 4 deletions.
    10 changes: 6 additions & 4 deletions gistfile1.rb
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,8 @@
    def something(foo,bar,baz)
    def some_method(a, b, c=5, *p, q)
    if (q) c=7
    other_method(a,b,c,p,q)
    end

    m = self.method(:something)
    m.parameters
    #=> [[:req, :foo], [:req, :bar], [:req, :baz]]
    def other_method(a, b, c=4, *p, q)

    end
  2. @trek trek renamed this gist Oct 21, 2010. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. @trek trek created this gist Oct 21, 2010.
    6 changes: 6 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    def something(foo,bar,baz)
    end

    m = self.method(:something)
    m.parameters
    #=> [[:req, :foo], [:req, :bar], [:req, :baz]]