Class: QueueNode
- Inherits:
-
Object
- Object
- QueueNode
- Defined in:
- lib/queue_node.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#next ⇒ Object
Returns the value of attribute next.
Instance Method Summary collapse
-
#initialize(data, next_node = nil) ⇒ QueueNode
constructor
A new instance of QueueNode.
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
#data ⇒ Object
Returns the value of attribute data.
2 3 4 |
# File 'lib/queue_node.rb', line 2 def data @data end |
#next ⇒ Object
Returns the value of attribute next.
2 3 4 |
# File 'lib/queue_node.rb', line 2 def next @next end |