Class: Ick::Invoker
- Inherits:
-
Object
- Object
- Ick::Invoker
- Defined in:
- lib/ick/base.rb
Instance Method Summary collapse
-
#initialize(value, clazz) ⇒ Invoker
constructor
A new instance of Invoker.
- #method_missing(sym, *args, &block) ⇒ Object
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 |