Sha256: 57dc1373ecef6ade7e0c05c96be579db92913c80aeb49f3d729e41bbc62939c3

Contents?: true

Size: 397 Bytes

Versions: 14

Compression:

Stored size: 397 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

14 entries across 14 versions & 1 rubygems

Version Path
outback-0.0.14 lib/outback/vendor/metaclass.rb
outback-0.0.13 lib/outback/vendor/metaclass.rb
outback-0.0.12 lib/outback/vendor/metaclass.rb
outback-0.0.11 lib/outback/vendor/metaclass.rb
outback-0.0.10 lib/outback/vendor/metaclass.rb
outback-0.0.9 lib/outback/vendor/metaclass.rb
outback-0.0.8 lib/outback/vendor/metaclass.rb
outback-0.0.7 lib/outback/vendor/metaclass.rb
outback-0.0.6 lib/outback/vendor/metaclass.rb
outback-0.0.5 lib/outback/vendor/metaclass.rb
outback-0.0.4 lib/outback/vendor/metaclass.rb
outback-0.0.3 lib/outback/vendor/metaclass.rb
outback-0.0.2 lib/outback/vendor/metaclass.rb
outback-0.0.1 lib/outback/vendor/metaclass.rb