Class: CircularLinked::Node
- Inherits:
-
Object
- Object
- CircularLinked::Node
- Defined in:
- lib/circular_linked/node.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.
6 7 8 9 |
# File 'lib/circular_linked/node.rb', line 6 def initialize(value, next_node = nil) @value = value @next = next_node end |
Instance Attribute Details
#next ⇒ Object
Returns the value of attribute next.
4 5 6 |
# File 'lib/circular_linked/node.rb', line 4 def next @next end |
#value ⇒ Object
Returns the value of attribute value.
4 5 6 |
# File 'lib/circular_linked/node.rb', line 4 def value @value end |