Class: Link

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(val) ⇒ Link

Returns a new instance of Link.



60
61
62
63
64
# File 'lib/doubly_linked_list.rb', line 60

def initialize(val)
  @val = val
  @next = nil
  @prev = nil
end

Instance Attribute Details

#nextObject

Returns the value of attribute next.



58
59
60
# File 'lib/doubly_linked_list.rb', line 58

def next
  @next
end

#prevObject

Returns the value of attribute prev.



58
59
60
# File 'lib/doubly_linked_list.rb', line 58

def prev
  @prev
end

#valObject

Returns the value of attribute val.



58
59
60
# File 'lib/doubly_linked_list.rb', line 58

def val
  @val
end