Class: Algorithmable::DataStructs::Bag::Node
- Inherits:
-
Object
- Object
- Algorithmable::DataStructs::Bag::Node
- Defined in:
- lib/algorithmable/data_structs/bag.rb
Instance Attribute Summary collapse
-
#item ⇒ Object
Returns the value of attribute item.
-
#succ ⇒ Object
Returns the value of attribute succ.
Instance Method Summary collapse
- #each {|_self| ... } ⇒ Object
-
#initialize(item) ⇒ Node
constructor
A new instance of Node.
Constructor Details
#initialize(item) ⇒ Node
Returns a new instance of Node.
30 31 32 33 |
# File 'lib/algorithmable/data_structs/bag.rb', line 30 def initialize(item) @item = item @succ = nil end |
Instance Attribute Details
#item ⇒ Object
Returns the value of attribute item.
28 29 30 |
# File 'lib/algorithmable/data_structs/bag.rb', line 28 def item @item end |
#succ ⇒ Object
Returns the value of attribute succ.
28 29 30 |
# File 'lib/algorithmable/data_structs/bag.rb', line 28 def succ @succ end |
Instance Method Details
#each {|_self| ... } ⇒ Object
35 36 37 38 |
# File 'lib/algorithmable/data_structs/bag.rb', line 35 def each(&block) yield self @succ.each(&block) if @succ end |