Class: Evaluation

Inherits:
Object
  • Object
show all
Defined in:
lib/logical/evaluation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#formulaObject (readonly)

Returns the value of attribute formula.



4
5
6
# File 'lib/logical/evaluation.rb', line 4

def formula
  @formula
end

#interpretationObject (readonly)

Returns the value of attribute interpretation.



4
5
6
# File 'lib/logical/evaluation.rb', line 4

def interpretation
  @interpretation
end

#valueObject (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_sObject



12
13
14
# File 'lib/logical/evaluation.rb', line 12

def to_s
  "#{interpretation.to_s}#{formula.to_s} = #{value}"
end