Class: Node
- Inherits:
-
Object
- Object
- Node
- Defined in:
- lib/node-list/node.rb
Direct Known Subclasses
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, nxt = nil) ⇒ Node
constructor
A new instance of Node.
Constructor Details
#initialize(value, nxt = nil) ⇒ Node
Returns a new instance of Node.
4 5 6 7 |
# File 'lib/node-list/node.rb', line 4 def initialize(value, nxt = nil) @value = value @next = nxt end |
Instance Attribute Details
#next ⇒ Object
Returns the value of attribute next.
2 3 4 |
# File 'lib/node-list/node.rb', line 2 def next @next end |
#value ⇒ Object
Returns the value of attribute value.
2 3 4 |
# File 'lib/node-list/node.rb', line 2 def value @value end |