Class: Foobara::LruCache::Node

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#keyObject (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

#nextObject

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

#prevObject

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

#valueObject (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