class CanadianMergers::CLI
CLI
Controller
Attributes
month[RW]
year[RW]
Public Instance Methods
call()
click to toggle source
# File lib/canadian_mergers/cli.rb, line 5 def call menu list_mergers goodbye end
goodbye()
click to toggle source
# File lib/canadian_mergers/cli.rb, line 27 def goodbye puts 'Would you like to convert this table to CSV? (Y/n)' input = gets.strip CanadianMergers::MergerList.to_csv(@year, @month) if /y/i =~ input end
list_mergers()
click to toggle source
# File lib/canadian_mergers/cli.rb, line 22 def list_mergers puts "Merger reviews concluded for the period of #{@month.capitalize}, #{@year}:" @merger_list = CanadianMergers::MergerList.table(@year, @month) end