Class: RainforestRubyRuntime::NilDelegator
- Inherits:
-
Object
- Object
- RainforestRubyRuntime::NilDelegator
- Defined in:
- lib/rainforest_ruby_runtime/nil_delegator.rb
Instance Method Summary collapse
-
#initialize(object) ⇒ NilDelegator
constructor
A new instance of NilDelegator.
- #method_missing(meth, *args, &block) ⇒ Object
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 |