Class: Mobj::Forwarder
- Inherits:
- BasicObject
- Defined in:
- lib/mobj.rb
Instance Attribute Summary collapse
-
#handler ⇒ Object
Returns the value of attribute handler.
-
#root ⇒ Object
Returns the value of attribute root.
Instance Method Summary collapse
-
#initialize(root = nil, &handler) ⇒ Forwarder
constructor
A new instance of Forwarder.
- #inspect ⇒ Object
- #method_missing(name, *args, &block) ⇒ Object
- #to_ary ⇒ Object
Constructor Details
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
11 |
# File 'lib/mobj.rb', line 11 def method_missing(name, *args, &block) handler.call(name, *args, &block) end |
Instance Attribute Details
#handler ⇒ Object
Returns the value of attribute handler.
9 10 11 |
# File 'lib/mobj.rb', line 9 def handler @handler end |