Module: Bocuse::ContextDelegation

Included in:
NodeContext
Defined in:
lib/bocuse/context_delegation.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



9
10
11
12
# File 'lib/bocuse/context_delegation.rb', line 9

def method_missing(sym, *args, &block)
  return @context.send(sym, *args, &block) if @context.respond_to?(sym)
  super
end

Instance Method Details

#respond_to?(sym) ⇒ Boolean

Method delegation to the context of this context. Every method not defined here may be defined there instead.

Returns:

  • (Boolean)


6
7
8
# File 'lib/bocuse/context_delegation.rb', line 6

def respond_to?(sym)
  super || @context.respond_to?(sym)
end