Class: RubyStructures::Node

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(list, value) ⇒ Node

Internal: Creates a new instance of Node.

list - instance of LinkedList to which the Node belongs. value - the value to be stored in the Node.

Examples

@node = RubyStructures::Node.new

Returns a new instance of Node.



17
18
19
20
# File 'lib/rubystructures/node.rb', line 17

def initialize(list, value)
	@list = list
	@value = value
end

Instance Attribute Details

#listObject (readonly)

Returns the value of attribute list.



5
6
7
# File 'lib/rubystructures/node.rb', line 5

def list
  @list
end

#nextObject

Returns the value of attribute next.



4
5
6
# File 'lib/rubystructures/node.rb', line 4

def next
  @next
end

#valueObject

Returns the value of attribute value.



3
4
5
# File 'lib/rubystructures/node.rb', line 3

def value
  @value
end