class ImHungry::CLI

Constants

NUM_PER_PAGE
URL

Public Class Methods

fetch_im_hungry() click to toggle source
# File lib/im_hungry/cli.rb, line 14
def self.fetch_im_hungry
  ImHungry::FetchJson.fetch(URL, ImHungry::FoodTruck)
end
filter_food_trucks!(food_trucks) click to toggle source
# File lib/im_hungry/cli.rb, line 18
def self.filter_food_trucks!(food_trucks)
  food_trucks.select!(&:currently_open?)
end
print(food_trucks) click to toggle source
sort_food_trucks!(food_trucks) click to toggle source
# File lib/im_hungry/cli.rb, line 22
def self.sort_food_trucks!(food_trucks)
  food_trucks.sort_by!(&:applicant)
end
start() click to toggle source
# File lib/im_hungry/cli.rb, line 6
def self.start
  food_trucks = fetch_im_hungry
  filter_food_trucks!(food_trucks)
  sort_food_trucks!(food_trucks)
  print(food_trucks)
  exit
end