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



118
119
120
# File 'lib/ea/ocl/evaluator.rb', line 118

def context
  @context
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



118
119
120
# File 'lib/ea/ocl/evaluator.rb', line 118

def value
  @value
end

#var_nameObject

Returns the value of attribute var_name

Returns:

  • (Object)

    the current value of var_name



118
119
120
# File 'lib/ea/ocl/evaluator.rb', line 118

def var_name
  @var_name
end

Instance Method Details

#public_send(method_name, *args) ⇒ Object



119
120
121
122
123
# File 'lib/ea/ocl/evaluator.rb', line 119

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

  context.public_send(method_name, *args)
end