Class: Simulator::BoundVariable
- Inherits:
-
Object
- Object
- Simulator::BoundVariable
- Defined in:
- lib/simulator/bound_variable.rb
Overview
represents a variable bound to a context
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#value ⇒ Object
Returns the value of attribute value.
-
#variable ⇒ Object
readonly
Returns the value of attribute variable.
Instance Method Summary collapse
-
#initialize(variable, context) ⇒ BoundVariable
constructor
A new instance of BoundVariable.
- #name ⇒ Object
Constructor Details
#initialize(variable, context) ⇒ BoundVariable
Returns a new instance of BoundVariable.
7 8 9 10 11 |
# File 'lib/simulator/bound_variable.rb', line 7 def initialize(variable, context) @variable = variable @value = @variable.default_value @context = context end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
5 6 7 |
# File 'lib/simulator/bound_variable.rb', line 5 def context @context end |
#value ⇒ Object
Returns the value of attribute value.
4 5 6 |
# File 'lib/simulator/bound_variable.rb', line 4 def value @value end |
#variable ⇒ Object (readonly)
Returns the value of attribute variable.
5 6 7 |
# File 'lib/simulator/bound_variable.rb', line 5 def variable @variable end |
Instance Method Details
#name ⇒ Object
13 14 15 |
# File 'lib/simulator/bound_variable.rb', line 13 def name @variable.name end |