Sha256: 46769aa96c67849b58f8fbb59d3d299ed7f760d976de86eab70b353abb82304c
Contents?: true
Size: 666 Bytes
Versions: 12
Compression:
Stored size: 666 Bytes
Contents
class Object # http://www.yohasebe.com/pages/trans-seeing-metaclasses-clearly/ def metaclass class << self self end end # http://www.yohasebe.com/pages/trans-seeing-metaclasses-clearly/ def meta_eval(&blk) metaclass.instance_eval(&blk) end # http://www.yohasebe.com/pages/trans-seeing-metaclasses-clearly/ def meta_def(name, &blk) meta_eval { define_method name, &blk } end # http://www.yohasebe.com/pages/trans-seeing-metaclasses-clearly/ def class_def(name, &blk) class_eval { define_method name, &blk } end # 1.8.7 エミュレート # TODO version 指定 def tap yield(self) self end end
Version data entries
12 entries across 12 versions & 1 rubygems