Class: LinkedListNode

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

Instance Method Summary collapse

Constructor Details

#initialize(key = nil, val = nil, next_node = nil, prev_node = nil) ⇒ LinkedListNode

Returns a new instance of LinkedListNode.



167
168
169
170
171
172
# File 'lib/data_structures/linked_list.rb', line 167

def initialize(key=nil, val=nil, next_node=nil, prev_node=nil)
  @key = key
  @val = val
  @next = next_node
  @prev = prev_node
end

Instance Method Details

#inspectObject



178
179
180
# File 'lib/data_structures/linked_list.rb', line 178

def inspect
  @val
end

#to_sObject



174
175
176
# File 'lib/data_structures/linked_list.rb', line 174

def to_s
  @val
end