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

Version Path
auser-poolparty-0.2.22 lib/poolparty/core/metaid.rb
auser-poolparty-0.2.23 lib/poolparty/core/metaid.rb
auser-poolparty-0.2.24 lib/poolparty/core/metaid.rb
auser-poolparty-0.2.25 lib/poolparty/core/metaid.rb
auser-poolparty-0.2.26 lib/poolparty/core/metaid.rb
auser-poolparty-0.2.35 lib/poolparty/core/metaid.rb
auser-poolparty-0.2.36 lib/poolparty/core/metaid.rb
auser-poolparty-0.2.37 lib/poolparty/core/metaid.rb
auser-poolparty-0.2.38 lib/poolparty/core/metaid.rb
auser-poolparty-0.2.39 lib/poolparty/core/metaid.rb
auser-poolparty-0.2.40 lib/poolparty/core/metaid.rb
auser-poolparty-0.2.41 lib/poolparty/core/metaid.rb
auser-poolparty-0.2.42 lib/poolparty/core/metaid.rb
auser-poolparty-0.2.44 lib/poolparty/core/metaid.rb
auser-poolparty-0.2.45 lib/poolparty/core/metaid.rb
auser-poolparty-0.2.46 lib/poolparty/core/metaid.rb
auser-poolparty-0.2.47 lib/poolparty/core/metaid.rb
auser-poolparty-0.2.48 lib/poolparty/core/metaid.rb
auser-poolparty-0.2.49 lib/poolparty/core/metaid.rb
auser-poolparty-0.2.50 lib/poolparty/core/metaid.rb