Class: Foobara::LruCache::Node
- Inherits:
-
Object
- Object
- Foobara::LruCache::Node
- Defined in:
- foobara-lru-cache-0.0.2/lib/foobara/lru_cache.rb
Overview
doubly-linked list whose methods live in LruCache for now
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#next ⇒ Object
Returns the value of attribute next.
-
#prev ⇒ Object
Returns the value of attribute prev.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(key, value) ⇒ Node
constructor
A new instance of Node.
Constructor Details
#initialize(key, value) ⇒ Node
Returns a new instance of Node.
8 9 10 11 |
# File 'foobara-lru-cache-0.0.2/lib/foobara/lru_cache.rb', line 8 def initialize(key, value) @value = value @key = key end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
6 7 8 |
# File 'foobara-lru-cache-0.0.2/lib/foobara/lru_cache.rb', line 6 def key @key end |
#next ⇒ Object
Returns the value of attribute next.
5 6 7 |
# File 'foobara-lru-cache-0.0.2/lib/foobara/lru_cache.rb', line 5 def next @next end |
#prev ⇒ Object
Returns the value of attribute prev.
5 6 7 |
# File 'foobara-lru-cache-0.0.2/lib/foobara/lru_cache.rb', line 5 def prev @prev end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
6 7 8 |
# File 'foobara-lru-cache-0.0.2/lib/foobara/lru_cache.rb', line 6 def value @value end |