APIdock / Ruby
/
method

parameters

ruby latest stable - Class: Proc
parameters()
public

Returns the parameter information of this proc.

prc = lambda{|x, y=42, *other|}
prc.parameters  #=> [[:req, :x], [:opt, :y], [:rest, :other]]
static VALUE
rb_proc_parameters(VALUE self)
{
 int is_proc;
 const rb_iseq_t *iseq = rb_proc_get_iseq(self, &is_proc);
 if (!iseq) {
 return unnamed_parameters(rb_proc_arity(self));
 }
 return rb_iseq_parameters(iseq, is_proc);
}

AltStyle によって変換されたページ (->オリジナル) /