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.
86 87 88 |
# File 'lib/hobo_support/methodcall.rb', line 86 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
90 91 92 |
# File 'lib/hobo_support/methodcall.rb', line 90 def method_missing(name, *args, &b) @target.send(name, *args, &b) if @target.respond_to?(name) end |