Class: CircularLinkedList::Node

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

Overview

Your code goes here…

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(node_value) ⇒ Node

Returns a new instance of Node.



8
9
10
11
12
# File 'lib/circular_linked_list.rb', line 8

def initialize node_value
  @node_value = node_value
  @prev_node = self
  @next_node = self
end

Instance Attribute Details

#next_nodeObject

Returns the value of attribute next_node.



6
7
8
# File 'lib/circular_linked_list.rb', line 6

def next_node
  @next_node
end

#node_valueObject

Returns the value of attribute node_value.



6
7
8
# File 'lib/circular_linked_list.rb', line 6

def node_value
  @node_value
end

#prev_nodeObject

Returns the value of attribute prev_node.



6
7
8
# File 'lib/circular_linked_list.rb', line 6

def prev_node
  @prev_node
end