Class: LiabilityProof::Tree::InteriorNode
- Inherits:
-
Struct
- Object
- Struct
- LiabilityProof::Tree::InteriorNode
- Includes:
- Node
- Defined in:
- lib/liability-proof/tree/interior_node.rb
Instance Attribute Summary collapse
-
#hash ⇒ Object
Returns the value of attribute hash.
-
#left ⇒ Object
Returns the value of attribute left.
-
#right ⇒ Object
Returns the value of attribute right.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(left, right) ⇒ InteriorNode
constructor
A new instance of InteriorNode.
Methods included from Node
#as_json, #formatted_value, #value_string
Constructor Details
#initialize(left, right) ⇒ InteriorNode
Returns a new instance of InteriorNode.
7 8 9 10 11 12 |
# File 'lib/liability-proof/tree/interior_node.rb', line 7 def initialize(left, right) super(left, right) self.value = left.value + right.value self.hash = generate_hash end |
Instance Attribute Details
#hash ⇒ Object
Returns the value of attribute hash
4 5 6 |
# File 'lib/liability-proof/tree/interior_node.rb', line 4 def hash @hash end |
#left ⇒ Object
Returns the value of attribute left
4 5 6 |
# File 'lib/liability-proof/tree/interior_node.rb', line 4 def left @left end |
#right ⇒ Object
Returns the value of attribute right
4 5 6 |
# File 'lib/liability-proof/tree/interior_node.rb', line 4 def right @right end |
#value ⇒ Object
Returns the value of attribute value
4 5 6 |
# File 'lib/liability-proof/tree/interior_node.rb', line 4 def value @value end |