Ruby has the class Proc
, which 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.
This class enables lambdas in this language.
In addition to Proc
has the class Method
, which has no descriptive in the documentation in addition to
Public Instance Methods
The question is whether non-anonymous functions, such as
def greet
"hello there"
end
are also objects. If they are objects, they are of class Proc
or Method
? And why are they or are they not objects?