Class: Node

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Node

Returns a new instance of Node.



4
5
6
7
# File 'lib/node.rb', line 4

def initialize(data)
  @data = data
  @next_node = nil
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



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

def data
  @data
end

#next_nodeObject

Returns the value of attribute next_node.



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

def next_node
  @next_node
end