Class: QueueNode

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data, next_node = nil) ⇒ QueueNode

Returns a new instance of QueueNode.



4
5
6
7
# File 'lib/queue_node.rb', line 4

def initialize(data, next_node=nil)
  @data = data
  @next = next_node
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



2
3
4
# File 'lib/queue_node.rb', line 2

def data
  @data
end

#nextObject

Returns the value of attribute next.



2
3
4
# File 'lib/queue_node.rb', line 2

def next
  @next
end