Module: StateFu::Methodical

Defined in:
lib/support/methodical.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.__define_method(method_name, &block) ⇒ Object

[View source]

4
5
6
7
8
# File 'lib/support/methodical.rb', line 4

def self.__define_method( method_name, &block )
  self.class.class_eval do
    define_method method_name, &block
  end
end

Instance Method Details

#__define_singleton_method(method_name, &block) ⇒ Object

[View source]

10
11
12
13
14
# File 'lib/support/methodical.rb', line 10

def __define_singleton_method( method_name, &block )
  (class << object; self; end).class_eval do
    define_method method_name, &block
  end
end