class Person
is syntactic sugar
same as
Person = Class.new
Note that Person
is just a regular constant!
class Person
def name
"Alice"
end
end
same as...
Person = Class.new
Person.class_eval do
def name
"Alice"
end
end
aka "eigenclass" (but "metaclass" is incorrect)
from http://blog.madebydna.com/all/code/2011/06/24/eigenclasses-demystified.html
from http://blog.madebydna.com/all/code/2011/06/24/eigenclasses-demystified.html
/