4
Ruby’s got the class Proc
, that is defined in the documentation as
Blocks of code that have been bound to a set of local variables. Once bound, the code may be called in Different contexts and still access those variables.
It is this class that enables Amble in that language.
Beyond the Proc
has the class Method
, which does not have a description in the documentation other than
Public Instance Methods
The question is whether the unnamed functions such as
def greet
"hello there"
end
are also objects. If they are objects, they are of the class Proc
or Method
? And why they are or are not objects?
Of course, in an abstract way, they are objects. But they’re objects inside Ruby?