Sha256: 66712568f52c92af455090f1689062d4d194d23665c71e706a0b4ef938080a81
Contents?: true
Size: 398 Bytes
Versions: 82
Compression:
Stored size: 398 Bytes
Contents
class Object # The hidden singleton lurks behind everyone def metaclass; class << self; self; end; end def meta_eval &blk; metaclass.instance_eval &blk; end # Adds methods to a metaclass def meta_def name, &blk meta_eval { define_method name, &blk } end # Defines an instance method within a class def class_def name, &blk class_eval { define_method name, &blk } end end
Version data entries
82 entries across 82 versions & 4 rubygems