Class: Jac::Configuration::EvaluationContext

Inherits:
Object
  • Object
show all
Defined in:
lib/jac/configuration.rb

Overview

Proxy class for getting actual values when referencing profile inside evaluated expressions

Instance Method Summary collapse

Constructor Details

#initialize(evaluator) ⇒ EvaluationContext

Returns a new instance of EvaluationContext.


329
330
331
# File 'lib/jac/configuration.rb', line 329

def initialize(evaluator)
  @evaluator = evaluator
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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


337
338
339
340
341
# File 'lib/jac/configuration.rb', line 337

def method_missing(meth, *args, &block)
  # rubocop ispection hack
  return super unless respond_to_missing?(meth, args, &block)
  @evaluator.evaluate(meth.to_s)
end

Instance Method Details

#respond_to_missing?(_meth, _args, &_block) ⇒ Boolean

Returns:

  • (Boolean)

333
334
335
# File 'lib/jac/configuration.rb', line 333

def respond_to_missing?(_meth, _args, &_block)
  true
end