Class: Algorithmable::DataStructs::LinkedList::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/algorithmable/data_structs/linked_list.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data, pred = nil, succ = nil) ⇒ Node

Returns a new instance of Node.



92
93
94
95
96
# File 'lib/algorithmable/data_structs/linked_list.rb', line 92

def initialize(data, pred = nil, succ = nil)
  @data = data
  @pred = pred
  @succ = succ
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



90
91
92
# File 'lib/algorithmable/data_structs/linked_list.rb', line 90

def data
  @data
end

#predObject

Returns the value of attribute pred.



89
90
91
# File 'lib/algorithmable/data_structs/linked_list.rb', line 89

def pred
  @pred
end

#succObject

Returns the value of attribute succ.



89
90
91
# File 'lib/algorithmable/data_structs/linked_list.rb', line 89

def succ
  @succ
end