Class: Object::TryProxy

Inherits:
Object show all
Defined in:
lib/volt/extra_core/try.rb

Instance Method Summary collapse

Constructor Details

#initialize(original) ⇒ TryProxy

Returns a new instance of TryProxy.



4
5
6
# File 'lib/volt/extra_core/try.rb', line 4

def initialize(original)
  @original = original
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



8
9
10
11
12
13
14
# File 'lib/volt/extra_core/try.rb', line 8

def method_missing(method_name, *args, &block)
  if @original.respond_to?(method_name)

  else
    NilProxy.new
  end
end