Class: DLinked::CacheList::Node
- Inherits:
-
List::Node
- Object
- List::Node
- DLinked::CacheList::Node
- Defined in:
- lib/d_linked/cache_list.rb
Overview
A specialized node for the ‘CacheList` that includes a `key`.
Instance Attribute Summary collapse
-
#key ⇒ Object
The cache key associated with this node.
Attributes inherited from List::Node
Instance Method Summary collapse
-
#initialize(value, prev = nil, next_node = nil, key = nil) ⇒ Node
constructor
Initializes a new CacheList Node.
Constructor Details
#initialize(value, prev = nil, next_node = nil, key = nil) ⇒ Node
Initializes a new CacheList Node.
56 57 58 59 |
# File 'lib/d_linked/cache_list.rb', line 56 def initialize(value, prev = nil, next_node = nil, key = nil) super(value, prev, next_node) @key = key end |
Instance Attribute Details
#key ⇒ Object
Returns The cache key associated with this node.
49 50 51 |
# File 'lib/d_linked/cache_list.rb', line 49 def key @key end |