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.



156
157
158
159
160
161
# File 'lib/data_structures/linked_list.rb', line 156

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



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

def inspect
  @val
end

#to_sObject



163
164
165
# File 'lib/data_structures/linked_list.rb', line 163

def to_s
  @val
end