Th
On Nov 15, 2010, at 3:00 PM, Guilherme Silveira wrote:
> Hi there,
>
>> $ jruby --1.9 -S irb
>> irb(main):001:0> lambda {|arg1, arg2, arg3=true, *rest|}.parameters
>> => [[:req, :arg1], [:req, :arg2], [:opt, :arg3], [:rest, :rest]]
> That's exactly what I needed and really easy to use. I do not have a
> problem to be only 1.9.x compatible.
> From the RubyClass object, how do I get to this "parameters" method? I
> did not see it in the API and that is surely my fault.
The method is defined in org.jruby.RubyProc.parameters(ThreadContext). There is
no JavaDoc, since it is bound to a Ruby process.
https://github.com/jruby/jruby/blob/master/src/org/jruby/RubyProc.java#LL360-424
>
> Werner, thanks for correcting it and as you mentioned, Asari's
> implementation seem to fit perfectly. For us who are trying to mix
> dependency injection within Ruby code that's the simplest and most CoC
> way to do it.
>
> Regards
>
> Guilherme Silveira
> Caelum | Ensino e Inovação
> http://www.caelum.com.br/