Class: Ds101::LinkedList::SingleLinkedList::Node
- Inherits:
-
Object
- Object
- Ds101::LinkedList::SingleLinkedList::Node
- Defined in:
- lib/ds_101/linked_list/single_linked_list.rb
Instance Attribute Summary collapse
-
#next ⇒ Object
Returns the value of attribute next.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(value:, next_node: nil) ⇒ Node
constructor
A new instance of Node.
Constructor Details
#initialize(value:, next_node: nil) ⇒ Node
Returns a new instance of Node.
65 66 67 68 |
# File 'lib/ds_101/linked_list/single_linked_list.rb', line 65 def initialize(value:, next_node: nil) @value = value @next = next_node end |
Instance Attribute Details
#next ⇒ Object
Returns the value of attribute next.
63 64 65 |
# File 'lib/ds_101/linked_list/single_linked_list.rb', line 63 def next @next end |
#value ⇒ Object
Returns the value of attribute value.
63 64 65 |
# File 'lib/ds_101/linked_list/single_linked_list.rb', line 63 def value @value end |