Skip to content

Instantly share code, notes, and snippets.

@adaedra
Created December 20, 2015 16:18
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 adaedra/7b6121918f64a8eae866 to your computer and use it in GitHub Desktop.
Save adaedra/7b6121918f64a8eae866 to your computer and use it in GitHub Desktop.
Rubinius `Method#parameters`
[1] pry(main)> RUBY_ENGINE
=> "ruby"
[2] pry(main)> def foo(a, b = nil, c:, d: nil); end
=> :foo
[3] pry(main)> method(:foo).parameters
=> [[:req, :a], [:opt, :b], [:keyreq, :c], [:key, :d]]
[4] pry(main)>
[1] pry(main)> RUBY_ENGINE
=> "rbx"
[2] pry(main)> def foo(a, b = nil, c:, d: nil); end
=> :foo
[3] pry(main)> method(:foo).parameters
=> [[:req, :a], [:opt, :b], [:opt, :"_:1"]]
[4] pry(main)>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment