Class: Coopy::IndexItem
- Inherits:
-
Object
- Object
- Coopy::IndexItem
- Defined in:
- lib/lib/coopy/index_item.rb
Instance Attribute Summary collapse
-
#lst ⇒ Object
protected - in ruby this doesn’t play well with static/inline methods.
Instance Method Summary collapse
- #add(i) ⇒ Object
- #as_list ⇒ Object
-
#initialize ⇒ IndexItem
constructor
A new instance of IndexItem.
- #length ⇒ Object
- #value ⇒ Object
Constructor Details
#initialize ⇒ IndexItem
Returns a new instance of IndexItem.
7 8 |
# File 'lib/lib/coopy/index_item.rb', line 7 def initialize end |
Instance Attribute Details
#lst ⇒ Object
protected - in ruby this doesn’t play well with static/inline methods
12 13 14 |
# File 'lib/lib/coopy/index_item.rb', line 12 def lst @lst end |
Instance Method Details
#add(i) ⇒ Object
16 17 18 19 20 |
# File 'lib/lib/coopy/index_item.rb', line 16 def add(i) @lst = Array.new if @lst == nil @lst.push(i) @lst.length end |
#as_list ⇒ Object
30 31 32 |
# File 'lib/lib/coopy/index_item.rb', line 30 def as_list @lst end |
#length ⇒ Object
22 23 24 |
# File 'lib/lib/coopy/index_item.rb', line 22 def length @lst.length end |
#value ⇒ Object
26 27 28 |
# File 'lib/lib/coopy/index_item.rb', line 26 def value @lst[0] end |