Hi
I start learning ruby since a week but i have some probleme to undestand
Proc
and the philosophy which hides behind .
Why don’t using methode ?
In this code vhere is the Proc?
Try your code again in irb.
then, in irb
times3.class
Should give you the answer.
Proc
When you def gen_times, actually, you are telling how to create an
instance of Proc with a code block. gen_times’s code block happens to
take the factor and multiply it by n
this is like a function object.
If you’ve only been at it one week, don’t worry. It will become clear!