This entry is for Ruby beginners.
Class Methods
Assume you have class A
and want to define a class method c
.
class + def + self.
singleton class
class_eval + def
Instance Methods
Assume you have class A
and want to define an instance method i
.
class + def
instance_eval + def
class_eval + define_method