Class: RubyStructures::Node
- Inherits:
-
Object
- Object
- RubyStructures::Node
- Defined in:
- lib/rubystructures/node.rb
Instance Attribute Summary collapse
-
#list ⇒ Object
readonly
Returns the value of attribute list.
-
#next ⇒ Object
Returns the value of attribute next.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(list, value) ⇒ Node
constructor
Internal: Creates a new instance of Node.
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
#list ⇒ Object (readonly)
Returns the value of attribute list.
5 6 7 |
# File 'lib/rubystructures/node.rb', line 5 def list @list end |
#next ⇒ Object
Returns the value of attribute next.
4 5 6 |
# File 'lib/rubystructures/node.rb', line 4 def next @next end |
#value ⇒ Object
Returns the value of attribute value.
3 4 5 |
# File 'lib/rubystructures/node.rb', line 3 def value @value end |