Class: HashCache::LinkedList::Node
- Inherits:
-
Object
- Object
- HashCache::LinkedList::Node
- Defined in:
- lib/hash_cache/linked_list.rb
Instance Attribute Summary collapse
-
#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(value, pointers = {}) ⇒ Node
constructor
A new instance of Node.
- #left? ⇒ Boolean
- #right? ⇒ Boolean
Constructor Details
#initialize(value, pointers = {}) ⇒ Node
Returns a new instance of Node.
103 104 105 106 107 |
# File 'lib/hash_cache/linked_list.rb', line 103 def initialize(value, pointers = {}) self.value = value self.right = pointers[:right] self.left = pointers[:left] end |
Instance Attribute Details
#left ⇒ Object
Returns the value of attribute left.
102 103 104 |
# File 'lib/hash_cache/linked_list.rb', line 102 def left @left end |
#right ⇒ Object
Returns the value of attribute right.
102 103 104 |
# File 'lib/hash_cache/linked_list.rb', line 102 def right @right end |
#value ⇒ Object
Returns the value of attribute value.
102 103 104 |
# File 'lib/hash_cache/linked_list.rb', line 102 def value @value end |
Instance Method Details
#left? ⇒ Boolean
110 |
# File 'lib/hash_cache/linked_list.rb', line 110 def left?; !left.nil? end |
#right? ⇒ Boolean
109 |
# File 'lib/hash_cache/linked_list.rb', line 109 def right?; !right.nil?; end |