Class: CallIfAvailable

Inherits:
BlankSlate show all
Defined in:
lib/hobo_support/methodcall.rb

Instance Method Summary collapse

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