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.71 lib/poolparty/core/metaid.rb
auser-poolparty-0.2.72 lib/poolparty/core/metaid.rb
auser-poolparty-0.2.74 lib/poolparty/core/metaid.rb
auser-poolparty-0.2.76 lib/poolparty/core/metaid.rb
auser-poolparty-0.2.77 lib/poolparty/core/metaid.rb
auser-poolparty-0.2.78 lib/poolparty/core/metaid.rb
auser-poolparty-0.2.79 lib/poolparty/core/metaid.rb
auser-poolparty-0.2.80 lib/poolparty/core/metaid.rb
auser-poolparty-0.2.81 lib/poolparty/core/metaid.rb
auser-poolparty-0.2.84 lib/poolparty/core/metaid.rb
auser-poolparty-0.2.85 lib/poolparty/core/metaid.rb
auser-poolparty-0.2.88 lib/poolparty/core/metaid.rb
auser-poolparty-0.2.89 lib/poolparty/core/metaid.rb
auser-poolparty-0.2.90 lib/poolparty/core/metaid.rb
auser-poolparty-0.2.91 lib/poolparty/core/metaid.rb
auser-poolparty-0.2.92 lib/poolparty/core/metaid.rb
auser-poolparty-0.2.93 lib/poolparty/core/metaid.rb
auser-poolparty-0.2.94 lib/poolparty/core/metaid.rb
auser-poolparty-1.0.0 lib/poolparty/core/metaid.rb
auser-poolparty-1.1.1 lib/poolparty/core/metaid.rb