lib/bills.rb in my-congress-0.2.6 vs lib/bills.rb in my-congress-0.2.7

- old
+ new

@@ -1,6 +1,5 @@ -require 'pry' class Bills def initialize page = Nokogiri::HTML(open('https://www.govtrack.us/congress/bills/')) @@ -25,19 +24,14 @@ bill_output(bill_array) end def bill_output(bill_array) - #limit max bills shown to 5 bills - x = bill_array.length - if x > 5 - x = 5 - end system "clear" puts " " puts " " - puts "#{x} bills and resolutions that are on the House and Senate calendars for the coming days: ".colorize(:blue) + puts "#{bill_array.length} bills and resolutions that are on the House and Senate calendars for the coming days: ".colorize(:blue) puts " " puts "------------------------------------------------------------------------------------------" puts " " bill_array.each do |bill| if !bill.empty? || bill != nil @@ -63,17 +57,17 @@ MyCongress.new.call elsif choice == 'EXIT' ProgramEnd.new else prompt = TTY::Prompt.new(active_color: :red) - num = prompt.select("Please choose one of the bills:".colorize(:blue)) do |menu| + bill_choice = prompt.select("Please choose one of the bills:".colorize(:blue)) do |menu| x = 0 while x < bill_array.length menu.choice "#{x+1}", "#{x}" x += 1 end end - bill_summary(bill_array, num) + bill_summary(bill_array, bill_choice) end end def bill_summary(bill_array, choice) \ No newline at end of file