- The class
Conjurer
is created.
Yes. More accurately, the Conjurer
class is opened, meaning that it's being opened for modification. In this case, the conjure
method is being added.
In Ruby, you can open a class many times:
class Conjurer
def self.something
# code
end
end
class Conjurer
def self.other_thing
# code
end
end
This is the same as doing
class Conjurer
def self.something
# code
end
def self.other_thing
# code
end
end
- An instance method of the class is called, representing the class itself.
No. It's not a method call, it's a method definition. The def
keyword defines a new method. The def self.
defines a method for the Conjurer
class rather than a Conjurer.new
instance.
- It is given permanent parameters
name
and lambda
.
Almost. The parameters are name
and lambda
, but they're not arguments of a call (see here for the difference between argument and parameter), because that isn't a method call, is a method definition.
- Unsure what
define_method name, lambda
means.
define_method
is part of the Ruby language. It does what is says, it defines a method with the name name
that when called, executes lambda
. See the docs here.