Class: DLinked::CacheList::Node
- Inherits:
-
List::Node
- Object
- List::Node
- DLinked::CacheList::Node
- Defined in:
- lib/d_linked/cache_list.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
Add an attribute to hold the cache key.
Attributes inherited from List::Node
Instance Method Summary collapse
-
#initialize(value, prev = nil, next_node = nil, key = nil) ⇒ Node
constructor
IMPORTANT: Accept the required three arguments from the base List#prepend, but only initialize the base class with value, prev, and next.
Constructor Details
#initialize(value, prev = nil, next_node = nil, key = nil) ⇒ Node
IMPORTANT: Accept the required three arguments from the base List#prepend, but only initialize the base class with value, prev, and next.
24 25 26 27 28 29 30 |
# File 'lib/d_linked/cache_list.rb', line 24 def initialize(value, prev = nil, next_node = nil, key = nil) # Call the parent Node initializer using the first three arguments super(value, prev, next_node) # Initialize the new, specialized attribute @key = key end |
Instance Attribute Details
#key ⇒ Object
Add an attribute to hold the cache key
20 21 22 |
# File 'lib/d_linked/cache_list.rb', line 20 def key @key end |