Class: Module

Inherits:
Object show all
Defined in:
lib/define-method/module_ext.rb

Instance Method Summary collapse

Instance Method Details

#define_method(name, *args, &blk) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/define-method/module_ext.rb', line 4

def define_method(name, *args, &blk)
  $define_method_blocks[self.to_s] ||= {}
  if block_given?
    $define_method_blocks[self.to_s][name] = lambda(&blk)
  elsif 
    $define_method_blocks[self.to_s][name] = args[0]      
  end
end