Class: ItemList::ItemList

Inherits:
Object show all
Defined in:
lib/itemlist.rb

Instance Method Summary collapse

Constructor Details

#initialize(list) ⇒ ItemList

Returns a new instance of ItemList.



20
21
22
23
# File 'lib/itemlist.rb', line 20

def initialize(list)
  @list = list
  assert !(list.to_s.include? ' i ')
end

Instance Method Details

#inspectObject



36
37
38
# File 'lib/itemlist.rb', line 36

def inspect
  to_s
end

#processObject



25
# File 'lib/itemlist.rb', line 25

def process; end

#to_sObject



27
28
29
30
31
32
33
34
# File 'lib/itemlist.rb', line 27

def to_s
  text = "#{@list.first.starting_to_s.uppercase.add_period} "

  @list[1..@list.length].each do |i|
    text += "#{q = i.to_s.uppercase.add_period} "
  end
  text = text.rstrip
end