class HouseFloorBills::CLI
Public Instance Methods
call()
click to toggle source
# File lib/house_floor_bills/cli.rb, line 5 def call welcome list_bills menu end
list_bills()
click to toggle source
# File lib/house_floor_bills/cli.rb, line 16 def list_bills s = HouseFloorBills::Scraper.new @schedule = s.scrape puts "\n\n-------------------------------------------".green puts "#{@schedule.title}".green puts "-------------------------------------------\n ".green @schedule.bills.each.with_index(1) do |bill, i| puts "#{i}." + " #{bill.number}".blue + " - #{bill.name}" end end
print_bill(the_bill)
click to toggle source
# File lib/house_floor_bills/cli.rb, line 29 def print_bill(the_bill) puts "\n[#{the_bill.number}] #{the_bill.name}" puts "----------------------------------------------------------------------\n " puts "Status: #{the_bill.status}" puts "Sponsor: #{the_bill.sponsor}" puts "Committees: #{the_bill.committees}" puts "URL: #{the_bill.url}" puts "PDF: #{the_bill.pdf}" puts "Summary: #{the_bill.summary}" end
print_commands()
click to toggle source
# File lib/house_floor_bills/cli.rb, line 40 def print_commands puts "\nEnter a number between '" + "1-#{@schedule.bills.length}".red + "' for more info on corresponding bill." puts "Enter '" + "open 1-#{@schedule.bills.length}".red + "' to open bill page in browser." puts "Enter '" + "pdf 1-#{@schedule.bills.length}".red + "' to open bill PDF in browser." puts "Enter '" + "live".red + "' to watch the U.S. House of Representatives live" puts "Enter '" + "list".red + "' to see the list of bills again." puts "Enter '" + "exit".red + "' to exit program." end
welcome()
click to toggle source
# File lib/house_floor_bills/cli.rb, line 11 def welcome puts "\nš " + " House Floor Bills ".blue + "š" puts "A simple CLI app to display the bills up for consideration on the U.S. House floor this week." end