Sha256: b0102c1b4c67e3bd38d34c554d02d05217fc88a2d588f4594950ab7ae2ffdc61

Contents?: true

Size: 239 Bytes

Versions: 16

Compression:

Stored size: 239 Bytes

Contents

class Object
  def metaclass
    class << self
      self
    end
  end
  
  def meta_eval(&block)
    metaclass.instance_eval &block
  end
  
  def meta_def(name, &block)
    meta_eval do
      define_method name, &block
    end
  end
end

Version data entries

16 entries across 16 versions & 7 rubygems

Version Path
eric-adhearsion-0.7.999 lib/adhearsion/core_extensions/metaprogramming.rb
eric-adhearsion-0.8.0 lib/adhearsion/foundation/metaprogramming.rb
jicksta-adhearsion-0.7.999 lib/adhearsion/foundation/metaprogramming.rb
jicksta-adhearsion-0.8.0 lib/adhearsion/foundation/metaprogramming.rb
jicksta-adhearsion-0.8.2 lib/adhearsion/foundation/metaprogramming.rb
jicksta-adhearsion-0.8.3 lib/adhearsion/foundation/metaprogramming.rb
kenwiesner-adhearsioncw-0.8.3 lib/adhearsion/foundation/metaprogramming.rb
mtrudel-adhearsion-0.8.3 lib/adhearsion/foundation/metaprogramming.rb
sant0sk1-adhearsion-0.7.999 lib/adhearsion/core_extensions/metaprogramming.rb
sevenscale-adhearsion-0.7.1000 lib/adhearsion/core_extensions/metaprogramming.rb
sevenscale-adhearsion-0.7.1003 lib/adhearsion/core_extensions/metaprogramming.rb
sevenscale-adhearsion-0.8.0 lib/adhearsion/foundation/metaprogramming.rb
adhearsion-0.8.3 lib/adhearsion/foundation/metaprogramming.rb
adhearsion-0.8.2 lib/adhearsion/foundation/metaprogramming.rb
adhearsion-0.8.0 lib/adhearsion/foundation/metaprogramming.rb
adhearsion-0.8.1 lib/adhearsion/foundation/metaprogramming.rb