Class: SingleLink
- Inherits:
-
Object
- Object
- SingleLink
- Defined in:
- lib/singly_linked_list.rb
Instance Attribute Summary collapse
-
#next ⇒ Object
Returns the value of attribute next.
-
#val ⇒ Object
Returns the value of attribute val.
Instance Method Summary collapse
-
#initialize(val) ⇒ SingleLink
constructor
A new instance of SingleLink.
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
#next ⇒ Object
Returns the value of attribute next.
56 57 58 |
# File 'lib/singly_linked_list.rb', line 56 def next @next end |
#val ⇒ Object
Returns the value of attribute val.
56 57 58 |
# File 'lib/singly_linked_list.rb', line 56 def val @val end |