Class: SingleLink

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(val) ⇒ SingleLink

Returns a new instance of SingleLink.


58
59
60
61
# File 'lib/singly_linked_list.rb', line 58

def initialize(val)
  @val = val
  @next = nil
end

Instance Attribute Details

#nextObject

Returns the value of attribute next


56
57
58
# File 'lib/singly_linked_list.rb', line 56

def next
  @next
end

#valObject

Returns the value of attribute val


56
57
58
# File 'lib/singly_linked_list.rb', line 56

def val
  @val
end