Module: EasyClassToInstanceMethod::ClassMethods

Defined in:
lib/easy_class_to_instance_method.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args, &block) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/easy_class_to_instance_method.rb', line 13

def method_missing(method_name, *args, &block)
  if method_exists?(method_name)
    self.new(*args).send(method_name, &block)
  else
    super
  end
end