Method: ExtraSpace::Crawl#process

Defined in:
lib/extraspace/crawl.rb

#process(url:) ⇒ Object



30
31
32
33
34
35
36
37
38
# File 'lib/extraspace/crawl.rb', line 30

def process(url:)
  @stdout.puts(url)
  facility = Facility.fetch(url: url)
  @stdout.puts(facility.text)
  facility.prices.each { |price| @stdout.puts(price.text) }
  @stdout.puts
rescue FetchError => e
  @stderr.puts("url=#{url} error=#{e.message}")
end