Shouldn't it be self >> class, or am I dyslexic?

B

Ben Tompkins

The semantics of

class X

...

class << self
def instance_method_for_class_object_named_X
...
end
end

end

is that an instance method is added (appended) to the current object X
== self by
the class definition that encloses the new method. Because we are
appending a new method to self, the arrows should point towards "self"
not "class."

nbits
 
B

Ben Tompkins

Oops,

Subject should read "... class >> self ..."

(Ok, maybe I am dyslexic -- but I'm still right -- just takes me a
couple
of tries to get the sequencing right.) :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top