class NYCTheaterDiscounts::CLI
Public Instance Methods
call()
click to toggle source
# File lib/nyc_theater_discounts/cli.rb, line 6 def call puts "*** Loading Deals ***" NYCTheaterDiscounts::Scraper.load_TodayTix NYCTheaterDiscounts::Scraper.load_Theatermania NYCTheaterDiscounts::Scraper.load_BroadwayBox puts "Hello theater nerd! Here are the discount sources available today:" list_vendors puts "To see a list of deals for each vendor type the number of the vendor. To search by show type 'by show'. To quit, type 'exit'." starting_menu goodbye end
goodbye()
click to toggle source
# File lib/nyc_theater_discounts/cli.rb, line 84 def goodbye puts "Thank you for using nyc-theater-discounts. Check back again tomorrow!" end
list_deals(vendor)
click to toggle source
# File lib/nyc_theater_discounts/cli.rb, line 53 def list_deals(vendor) puts "\nTo visit #{vendor.name} go to: #{vendor.url}\n\n" vendor.shows.each_with_index do |show, index| puts "#{index+1}. #{show.name} -- available from: #{show.price}" puts "**to see this offer visit: #{show.deal_url}**\n\n" end end
list_vendors()
click to toggle source
# File lib/nyc_theater_discounts/cli.rb, line 49 def list_vendors NYCTheaterDiscounts::Vendor.all.each_with_index {|value, index| puts "#{index+1}. #{value.name}"} end