class Person
is syntactic sugar
same as
Person = Class.new
Note that Person
is just a regular constant!
defining a class with class_eval
class Person
def name
"Alice"
end
end
same as...
Person = Class.new
Person.class_eval do
def name
"Alice"
end
end