Class: SimplePvr::ProgrammeIconFetcher

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

Class Method Summary collapse

Class Method Details

.fetch(url, destination_file) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/simple_pvr/programme_icon_fetcher.rb', line 5

def self.fetch(url, destination_file)
  Thread.new do
    File.open(destination_file, "wb") do |saved_file|
      open(url, 'rb') do |read_file|
        saved_file.write(read_file.read)
      end
    end
  end
end