Class: DataStructList::Node
- Inherits:
-
Object
- Object
- DataStructList::Node
- Defined in:
- lib/data_struct_list.rb
Instance Attribute Summary collapse
-
#hash ⇒ Object
Returns the value of attribute hash.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#next ⇒ Object
Returns the value of attribute next.
Instance Method Summary collapse
-
#initialize(hash) ⇒ Node
constructor
A new instance of Node.
Constructor Details
#initialize(hash) ⇒ Node
Returns a new instance of Node.
15 16 17 18 19 20 21 |
# File 'lib/data_struct_list.rb', line 15 def initialize(hash) @@id_quantify ||= 0 @id = @@id_quantify @@id_quantify+=1 @hash = hash @next = nil end |
Instance Attribute Details
#hash ⇒ Object
Returns the value of attribute hash.
12 13 14 |
# File 'lib/data_struct_list.rb', line 12 def hash @hash end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
13 14 15 |
# File 'lib/data_struct_list.rb', line 13 def id @id end |
#next ⇒ Object
Returns the value of attribute next.
12 13 14 |
# File 'lib/data_struct_list.rb', line 12 def next @next end |