Class: Object::TryObject

Inherits:
Object show all
Defined in:
lib/core_ext/object.rb

Instance Method Summary collapse

Constructor Details

#initialize(original_object) ⇒ TryObject

Returns a new instance of TryObject.



6
7
8
9
# File 'lib/core_ext/object.rb', line 6

def initialize(original_object)
  @original_object = original_object
  
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



11
12
13
# File 'lib/core_ext/object.rb', line 11

def method_missing(method, *args, &block)
  @original_object.send(method, *args, &block) if(@original_object.respond_to? method) 
end