class GroceryList::CLI
Public Instance Methods
call()
click to toggle source
# File lib/grocery_list/cli.rb, line 4 def call store_list menu end
item_list(store_url)
click to toggle source
# File lib/grocery_list/cli.rb, line 70 def item_list(store_url) @item = GroceryList::Item.create_item(store_url) @item.each do |x| puts "Product: #{x.name}" puts "Size: #{x.size}" puts "Price: #{x.price}" puts "Coupon: #{x.coupon}" # puts "Minimum Quantity: #{x.quantity}" puts " ___________________________________ \n" end end
store_list()
click to toggle source
input = nil while input != “exit”
input = gets.strip puts "Gain with FreshLock Island Fresh Dryer Sheets 120 ct - $2.50" puts "$2.00/1 – Gain Liquid Laundry Detergent 40 oz, Fabric Enhancer 52 load or Dryer Sheets 120 ct or larger (coupons.com)" puts "Final Price is $0.50"
end
# File lib/grocery_list/cli.rb, line 18 def store_list @store = GroceryList::Store.each_store @store.each_with_index do |store, index| index +=1 puts "#{index}. #{store.name}" end end