Module: Ruote::WithMeta

Included in:
Exp::FlowExpression
Defined in:
lib/ruote/util/ometa.rb

Overview

meta a la lucky stiff

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Object) included(target)



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/ruote/util/ometa.rb', line 35

def self.included(target)

  def target.metaclass
    class << self
      self
    end
  end
  def target.meta_eval(&block)
    metaclass.instance_eval(&block)
  end
  def target.meta_def(method_name, &block)
    meta_eval { define_method method_name, &block }
  end
  def class_def(method_name, &block)
    class_eval { define_method name, &block }
  end
end

Instance Method Details

- (Object) class_def(method_name, &block)



48
49
50
# File 'lib/ruote/util/ometa.rb', line 48

def class_def(method_name, &block)
  class_eval { define_method name, &block }
end