Class: Ds101::LinkedList::DoubleLinkedList::Node
- Inherits:
-
Object
- Object
- Ds101::LinkedList::DoubleLinkedList::Node
- Defined in:
- lib/ds_101/linked_list/double_linked_list.rb
Instance Attribute Summary collapse
-
#next ⇒ Object
Returns the value of attribute next.
-
#prev ⇒ Object
Returns the value of attribute prev.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(value:, next_node: nil, prev_node: nil) ⇒ Node
constructor
A new instance of Node.
Constructor Details
#initialize(value:, next_node: nil, prev_node: nil) ⇒ Node
Returns a new instance of Node.
13 14 15 16 17 |
# File 'lib/ds_101/linked_list/double_linked_list.rb', line 13 def initialize(value:, next_node: nil, prev_node: nil) @value = value @next = next_node @prev = prev_node end |
Instance Attribute Details
#next ⇒ Object
Returns the value of attribute next.
11 12 13 |
# File 'lib/ds_101/linked_list/double_linked_list.rb', line 11 def next @next end |
#prev ⇒ Object
Returns the value of attribute prev.
11 12 13 |
# File 'lib/ds_101/linked_list/double_linked_list.rb', line 11 def prev @prev end |
#value ⇒ Object
Returns the value of attribute value.
11 12 13 |
# File 'lib/ds_101/linked_list/double_linked_list.rb', line 11 def value @value end |