Method: CodeLabs::CLI#list_items

Defined in:
lib/code_labs/cli.rb

#list_itemsObject

handles the proper formatting for the current list



58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/code_labs/cli.rb', line 58

def list_items
    if @items[0].is_a?(CodeLabs::Tech)
        puts "\n------------------Pick A Tech-----------------"
        puts ""
        @items.each.with_index(1) {|tech, index| puts "#{index}. #{tech.name}" }
        puts ""
    elsif @items[0].is_a?(CodeLabs::Lab)
        puts "\n------------------Pick A Lab-----------------"
        puts ""
        @items.each.with_index(1) {|lab, index| puts "#{index}. #{lab.title}" }
        puts ""
    end
end