Class: Evaluation
- Inherits:
-
Object
- Object
- Evaluation
- Defined in:
- lib/logical/evaluation.rb
Instance Attribute Summary collapse
-
#formula ⇒ Object
readonly
Returns the value of attribute formula.
-
#interpretation ⇒ Object
readonly
Returns the value of attribute interpretation.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(interpretation, formula) ⇒ Evaluation
constructor
A new instance of Evaluation.
- #to_s ⇒ Object
Constructor Details
#initialize(interpretation, formula) ⇒ Evaluation
Returns a new instance of Evaluation.
6 7 8 9 10 |
# File 'lib/logical/evaluation.rb', line 6 def initialize(interpretation, formula) @interpretation = interpretation @formula = formula @value = formula.evaluate(interpretation) end |
Instance Attribute Details
#formula ⇒ Object (readonly)
Returns the value of attribute formula.
4 5 6 |
# File 'lib/logical/evaluation.rb', line 4 def formula @formula end |
#interpretation ⇒ Object (readonly)
Returns the value of attribute interpretation.
4 5 6 |
# File 'lib/logical/evaluation.rb', line 4 def interpretation @interpretation end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
4 5 6 |
# File 'lib/logical/evaluation.rb', line 4 def value @value end |
Instance Method Details
#to_s ⇒ Object
12 13 14 |
# File 'lib/logical/evaluation.rb', line 12 def to_s "#{interpretation.to_s} ⇒ #{formula.to_s} = #{value}" end |