class DailyProperties::CLI

CLI Controller

Public Instance Methods

call() click to toggle source
# File lib/daily_properties/cli.rb, line 10
def call
    puts "Please enter the zipcode, and I will list the most recently sold properties in that area for you: "
    zipcode = gets.strip.to_i
    list_properties(zipcode)
    menu
end
goodbye() click to toggle source
# File lib/daily_properties/cli.rb, line 55
def goodbye
    puts "Thanks for trying me out. See you soon!"
    puts "--------------------------------------------------"
end
list_properties(zipcode) click to toggle source
# File lib/daily_properties/cli.rb, line 17
def list_properties(zipcode)
    DailyProperties::Scraper.make_properties(zipcode)
    @properties = DailyProperties::Property.properties
    @properties.each.with_index(1) do |property, i|
        puts "#{i}. #{property.address}, #{property.sold_date}, #{property.price}"
    end
    puts "--------------------------------------------------"
end
menu() click to toggle source
welcome() click to toggle source
# File lib/daily_properties/cli.rb, line 5
def welcome
    print "Welcome! "
    call
end