Class: Alchemist::Formula
Instance Attribute Summary collapse
-
#elem_1 ⇒ Object
readonly
Returns the value of attribute elem_1.
-
#elem_2 ⇒ Object
readonly
Returns the value of attribute elem_2.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(elem_1, elem_2, result) ⇒ Formula
constructor
A new instance of Formula.
- #to_s ⇒ Object
Constructor Details
#initialize(elem_1, elem_2, result) ⇒ Formula
Returns a new instance of Formula.
6 7 8 9 10 |
# File 'lib/alchemist-server/formula.rb', line 6 def initialize(elem_1, elem_2, result) @elem_1 = elem_1 @elem_2 = elem_2 @result = result end |
Instance Attribute Details
#elem_1 ⇒ Object (readonly)
Returns the value of attribute elem_1.
4 5 6 |
# File 'lib/alchemist-server/formula.rb', line 4 def elem_1 @elem_1 end |
#elem_2 ⇒ Object (readonly)
Returns the value of attribute elem_2.
4 5 6 |
# File 'lib/alchemist-server/formula.rb', line 4 def elem_2 @elem_2 end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
4 5 6 |
# File 'lib/alchemist-server/formula.rb', line 4 def result @result end |
Instance Method Details
#==(other) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/alchemist-server/formula.rb', line 16 def ==(other) other.class == self.class && other.elem_1 == elem_1 && other.elem_2 == elem_2 && other.result == result end |
#to_s ⇒ Object
12 13 14 |
# File 'lib/alchemist-server/formula.rb', line 12 def to_s "⨍ #{@elem_1}#{@elem_2}#{@result}" end |