Class: DSA::ListNode
- Inherits:
-
Object
- Object
- DSA::ListNode
- Defined in:
- lib/DSA/list.rb
Overview
Node
Instance Attribute Summary collapse
-
#element ⇒ Object
Returns the value of attribute element.
-
#next ⇒ Object
Returns the value of attribute next.
-
#prev ⇒ Object
Returns the value of attribute prev.
Instance Method Summary collapse
-
#initialize(e) ⇒ ListNode
constructor
A new instance of ListNode.
Constructor Details
#initialize(e) ⇒ ListNode
Returns a new instance of ListNode.
11 12 13 14 15 |
# File 'lib/DSA/list.rb', line 11 def initialize(e) @element = e @prev = nil @next = nil end |
Instance Attribute Details
#element ⇒ Object
Returns the value of attribute element.
10 11 12 |
# File 'lib/DSA/list.rb', line 10 def element @element end |
#next ⇒ Object
Returns the value of attribute next.
10 11 12 |
# File 'lib/DSA/list.rb', line 10 def next @next end |
#prev ⇒ Object
Returns the value of attribute prev.
10 11 12 |
# File 'lib/DSA/list.rb', line 10 def prev @prev end |