Class: Zadt::DoublyLinkedListNode

Inherits:
Object
  • Object
show all
Defined in:
lib/zadt/AbstractDataTypes/LinkedList/DoublyLinkedList.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(val = nil, next_ = nil) ⇒ DoublyLinkedListNode

Returns a new instance of DoublyLinkedListNode.



5
6
7
8
9
10
11
12
13
# File 'lib/zadt/AbstractDataTypes/LinkedList/DoublyLinkedList.rb', line 5

def initialize(val = nil, next_ = nil)
  @val = val
  if !next_
    @next = next_
  else
    self.next = next_
  end
  @prev = nil
end

Instance Attribute Details

#nextObject

Returns the value of attribute next.



4
5
6
# File 'lib/zadt/AbstractDataTypes/LinkedList/DoublyLinkedList.rb', line 4

def next
  @next
end

#prevObject

Returns the value of attribute prev.



4
5
6
# File 'lib/zadt/AbstractDataTypes/LinkedList/DoublyLinkedList.rb', line 4

def prev
  @prev
end

#valObject

Returns the value of attribute val.



3
4
5
# File 'lib/zadt/AbstractDataTypes/LinkedList/DoublyLinkedList.rb', line 3

def val
  @val
end

Class Method Details

.helpObject



29
30
31
# File 'lib/zadt/AbstractDataTypes/LinkedList/DoublyLinkedList.rb', line 29

def self.help
  LinkedListNode.show_help_message
end

Instance Method Details

#helpObject



25
26
27
# File 'lib/zadt/AbstractDataTypes/LinkedList/DoublyLinkedList.rb', line 25

def help
  LinkedListNode.help
end