Class: RainforestRubyRuntime::NilDelegator

Inherits:
Object
  • Object
show all
Defined in:
lib/rainforest_ruby_runtime/nil_delegator.rb

Instance Method Summary collapse

Constructor Details

#initialize(object) ⇒ NilDelegator

Returns a new instance of NilDelegator.



3
4
5
# File 'lib/rainforest_ruby_runtime/nil_delegator.rb', line 3

def initialize(object)
  @object = object
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



7
8
9
10
11
# File 'lib/rainforest_ruby_runtime/nil_delegator.rb', line 7

def method_missing(meth, *args, &block)
  if @object.respond_to?(meth)
    @object.public_send(meth, *args, &block)
  end
end