Class: Mudis::LRUNode

Inherits:
Object
  • Object
show all
Defined in:
lib/mudis.rb

Overview

Node structure for the LRU doubly-linked list

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key) ⇒ LRUNode

Returns a new instance of LRUNode.



30
31
32
33
34
# File 'lib/mudis.rb', line 30

def initialize(key)
  @key = key
  @prev = nil
  @next = nil
end

Instance Attribute Details

#keyObject

Returns the value of attribute key.



29
30
31
# File 'lib/mudis.rb', line 29

def key
  @key
end

#nextObject

Returns the value of attribute next.



29
30
31
# File 'lib/mudis.rb', line 29

def next
  @next
end

#prevObject

Returns the value of attribute prev.



29
30
31
# File 'lib/mudis.rb', line 29

def prev
  @prev
end