Class: DataStructList::Node

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#hashObject

Returns the value of attribute hash.



12
13
14
# File 'lib/data_struct_list.rb', line 12

def hash
  @hash
end

#idObject (readonly)

Returns the value of attribute id.



13
14
15
# File 'lib/data_struct_list.rb', line 13

def id
  @id
end

#nextObject

Returns the value of attribute next.



12
13
14
# File 'lib/data_struct_list.rb', line 12

def next
  @next
end