module Trestle::EvaluationContext

This module facilitiates the delegation of missing methods to a given @context variable.

This allows code such as adapter and navigation blocks to be evaluated with access to methods from both the Adapter/Navigation instance, as well as the controller/view from where they are invoked.

Protected Class Methods

ruby2_keywords(*) click to toggle source
# File lib/trestle/evaluation_context.rb, line 8
def self.ruby2_keywords(*)
end

Protected Instance Methods

method_missing(name, *args, &block) click to toggle source
Calls superclass method
# File lib/trestle/evaluation_context.rb, line 15
               def method_missing(name, *args, &block)
  if context_responds_to?(name)
    @context.send(name, *args, &block)
  else
    super
  end
end
respond_to_missing?(name, include_private=false) click to toggle source
Calls superclass method
# File lib/trestle/evaluation_context.rb, line 23
def respond_to_missing?(name, include_private=false)
  context_responds_to?(name) || super
end

Private Instance Methods

context_responds_to?(name) click to toggle source
# File lib/trestle/evaluation_context.rb, line 28
def context_responds_to?(name)
  @context && @context.respond_to?(name, true)
end