Class: TrickBag::Collections::LinkedList::Node

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value, next_node = nil) ⇒ Node

Returns a new instance of Node.



11
12
13
14
# File 'lib/trick_bag/collections/linked_list.rb', line 11

def initialize(value, next_node = nil)
  @value = value
  @next = next_node
end

Instance Attribute Details

#nextObject

Returns the value of attribute next.



9
10
11
# File 'lib/trick_bag/collections/linked_list.rb', line 9

def next
  @next
end

#valueObject

Returns the value of attribute value.



9
10
11
# File 'lib/trick_bag/collections/linked_list.rb', line 9

def value
  @value
end