Class: Ick::Invoker

Inherits:
Object
  • Object
show all
Defined in:
lib/ick/base.rb

Instance Method Summary collapse

Constructor Details

#initialize(value, clazz) ⇒ Invoker

Returns a new instance of Invoker.



79
80
81
82
# File 'lib/ick/base.rb', line 79

def initialize(value, clazz)
  @value = value
  @clazz = clazz
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



84
85
86
87
88
# File 'lib/ick/base.rb', line 84

def method_missing(sym, *args, &block)
  @clazz.instance.invoke(@value) { |value|
    value.__send__(sym, *args, &block)
  }
end