Class: BasicQueue::Node

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

Overview

See Also:

Author:

  • Robert Sedgewick

  • Kevin Wayne

  • Michael Imstepf

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(item, next_node) ⇒ Node

Returns a new instance of Node.



124
125
126
127
# File 'lib/basic_queue.rb', line 124

def initialize(item, next_node)
  @item = item
  @next_node = next_node
end

Instance Attribute Details

#itemObject (readonly)

Returns the value of attribute item.



121
122
123
# File 'lib/basic_queue.rb', line 121

def item
  @item
end

#next_nodeObject

Returns the value of attribute next_node.



122
123
124
# File 'lib/basic_queue.rb', line 122

def next_node
  @next_node
end