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.


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

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

Instance Attribute Details

#nextObject

Returns the value of attribute next


54
55
56
# File 'lib/doubly_linked_list.rb', line 54

def next
  @next
end

#prevObject

Returns the value of attribute prev


54
55
56
# File 'lib/doubly_linked_list.rb', line 54

def prev
  @prev
end

#valObject

Returns the value of attribute val


54
55
56
# File 'lib/doubly_linked_list.rb', line 54

def val
  @val
end