Class: Coopy::IndexItem

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeIndexItem

Returns a new instance of IndexItem.



7
8
# File 'lib/lib/coopy/index_item.rb', line 7

def initialize
end

Instance Attribute Details

#lstObject

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_listObject



30
31
32
# File 'lib/lib/coopy/index_item.rb', line 30

def as_list 
  @lst
end

#lengthObject



22
23
24
# File 'lib/lib/coopy/index_item.rb', line 22

def length 
  @lst.length
end

#valueObject



26
27
28
# File 'lib/lib/coopy/index_item.rb', line 26

def value 
  @lst[0]
end