Class: CallIfAvailable
- Inherits:
-
BlankSlate
- Object
- BlankSlate
- CallIfAvailable
- Defined in:
- lib/hobo_support/methodcall.rb
Instance Method Summary collapse
-
#initialize(target) ⇒ CallIfAvailable
constructor
A new instance of CallIfAvailable.
- #method_missing(name, *args, &b) ⇒ Object
Constructor Details
#initialize(target) ⇒ CallIfAvailable
Returns a new instance of CallIfAvailable.
107 108 109 |
# File 'lib/hobo_support/methodcall.rb', line 107 def initialize(target) @target = target end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &b) ⇒ Object
111 112 113 |
# File 'lib/hobo_support/methodcall.rb', line 111 def method_missing(name, *args, &b) @target.send(name, *args, &b) if @target.respond_to?(name) end |