I looked up the to_ary method of the Array class. I am confused how the method relates to its source doc.
to_ary method => Returns self
If I do this:
1.9.3-p0 :013 > a = [1,33,42]
=> [1, 33, 42]
1.9.3-p0 :014 > a.to_ary
=> [1, 33, 42]
1.9.3-p0 :015 > a
=>[1, 33, 42]
Why is the attribute static VALUE necessary? Is VALUE the retriever? Does a space (instead of a comma) between arguments mean the second argument is the method called by the receiver?
static VALUE
rb_ary_to_ary_m(VALUE ary)
{
return ary;
}
Best,
cj3kim
This is C code. The Ruby interpreter is wrote in the C language. In this code, the first argument is used as
self. A equivalent in ruby would be: