Class: Algorithmix::DataStructure::Generic::LinkedList::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/algorithmix/data_structure/generic/linked_list.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value = nil, next_node = nil, id = nil) ⇒ Node

Returns a new instance of Node.



425
426
427
428
429
# File 'lib/algorithmix/data_structure/generic/linked_list.rb', line 425

def initialize(value = nil, next_node = nil, id = nil)
  @value = value
  @next_node = next_node
  @id = id
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



422
423
424
# File 'lib/algorithmix/data_structure/generic/linked_list.rb', line 422

def id
  @id
end

#next_nodeObject

Returns the value of attribute next_node.



423
424
425
# File 'lib/algorithmix/data_structure/generic/linked_list.rb', line 423

def next_node
  @next_node
end

#valueObject

Returns the value of attribute value.



423
424
425
# File 'lib/algorithmix/data_structure/generic/linked_list.rb', line 423

def value
  @value
end