Class: Node

Inherits:
Object
  • Object
show all
Defined in:
lib/node-list/node.rb

Direct Known Subclasses

NodeList

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nextObject

Returns the value of attribute next.



2
3
4
# File 'lib/node-list/node.rb', line 2

def next
  @next
end

#valueObject

Returns the value of attribute value.



2
3
4
# File 'lib/node-list/node.rb', line 2

def value
  @value
end