Method: CodeLabs::CLI#pick_item

Defined in:
lib/code_labs/cli.rb

#pick_item(index) ⇒ Object

This function will deal with picking an item



45
46
47
48
49
50
51
52
53
54
55
# File 'lib/code_labs/cli.rb', line 45

def pick_item(index)
    item = @items[index]
    return puts("Can't seem to find that index :-(\n(pst, try 'list')") if item.nil? # check if the item is in the input list

    if item.is_a?(CodeLabs::Tech) # The go into that tech

        @items = item.labs
        list_items
    elsif item.is_a?(CodeLabs::Lab)
        print_lab(item)
    end
    #TODO handle different item types

end