Class: DownloadService

Inherits:
Object
  • Object
show all
Defined in:
lib/download_service.rb

Class Method Summary collapse

Class Method Details

.call(url, mode = :default) ⇒ Object



4
5
6
7
8
9
# File 'lib/download_service.rb', line 4

def self.call(url, mode = :default)
  begin
    mode == :read_by_line ? open(url).readlines : open(url).read
  rescue OpenURI::HTTPError
  end
end