Class: Contender::LinkedQueue::Node
- Inherits:
-
Object
- Object
- Contender::LinkedQueue::Node
- Defined in:
- lib/contender/linked_queue.rb
Overview
Definition of a node in the linked list
Instance Attribute Summary collapse
Instance Method Summary collapse
- #clear_element ⇒ Object
- #clear_next ⇒ Object
- #element! ⇒ Object
-
#initialize(element = nil) ⇒ Node
constructor
A new instance of Node.
Constructor Details
#initialize(element = nil) ⇒ Node
Returns a new instance of Node.
319 320 321 |
# File 'lib/contender/linked_queue.rb', line 319 def initialize(element = nil) @element = element end |
Instance Attribute Details
#element ⇒ Object
315 316 317 |
# File 'lib/contender/linked_queue.rb', line 315 def element @element end |
Instance Method Details
#clear_element ⇒ Object
329 330 331 |
# File 'lib/contender/linked_queue.rb', line 329 def clear_element @element = nil end |
#clear_next ⇒ Object
333 334 335 |
# File 'lib/contender/linked_queue.rb', line 333 def clear_next @next = nil end |
#element! ⇒ Object
323 324 325 326 327 |
# File 'lib/contender/linked_queue.rb', line 323 def element! @element.tap do @element = nil end end |