Sha256: d894cb8155005cfcc3bb37986bb31242ce08238d7a05f960a1aebef3d63b3641
Contents?: true
Size: 433 Bytes
Versions: 3
Compression:
Stored size: 433 Bytes
Contents
# encoding: utf-8 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
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
build-tool-0.0.3 | lib/kde-build/metaaid.rb |
build-tool-0.0.1 | lib/kde-build/metaaid.rb |
build-tool-0.0.2 | lib/kde-build/metaaid.rb |