Class: DSAVisualizer::DataStructures::Node
- Inherits:
-
Object
- Object
- DSAVisualizer::DataStructures::Node
- Defined in:
- lib/dsa_visualizer/data_structures/linked_list.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) ⇒ Node
constructor
A new instance of Node.
Constructor Details
#initialize(data) ⇒ Node
Returns a new instance of Node.
6 7 8 9 |
# File 'lib/dsa_visualizer/data_structures/linked_list.rb', line 6 def initialize(data) @data = data @next = nil end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
4 5 6 |
# File 'lib/dsa_visualizer/data_structures/linked_list.rb', line 4 def data @data end |
#next ⇒ Object
Returns the value of attribute next.
4 5 6 |
# File 'lib/dsa_visualizer/data_structures/linked_list.rb', line 4 def next @next end |