Class: Ea::Ocl::Evaluator::VarBinding

Inherits:
Struct
  • Object
show all
Defined in:
lib/ea/ocl/evaluator.rb

Overview

Bind a variable name in the evaluation context. Uses a small Struct wrapper so attribute lookups still fall through to the original context.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#contextObject

Returns the value of attribute context

Returns:

  • (Object)

    the current value of context



81
82
83
# File 'lib/ea/ocl/evaluator.rb', line 81

def context
  @context
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



81
82
83
# File 'lib/ea/ocl/evaluator.rb', line 81

def value
  @value
end

#var_nameObject

Returns the value of attribute var_name

Returns:

  • (Object)

    the current value of var_name



81
82
83
# File 'lib/ea/ocl/evaluator.rb', line 81

def var_name
  @var_name
end

Instance Method Details

#public_send(method_name, *args) ⇒ Object



82
83
84
85
86
# File 'lib/ea/ocl/evaluator.rb', line 82

def public_send(method_name, *args)
  return value if method_name == var_name

  context.public_send(method_name, *args)
end