Class: RemoteTranslationLoader::Fetchers::HttpFetcher

Inherits:
BaseFetcher
  • Object
show all
Defined in:
lib/remote_translation_loader/fetchers/file_fetcher.rb

Instance Method Summary collapse

Methods inherited from BaseFetcher

#parse

Instance Method Details

#fetch(url) ⇒ Object



8
9
10
11
12
13
# File 'lib/remote_translation_loader/fetchers/file_fetcher.rb', line 8

def fetch(url)
  response = HTTP.get(url)
  raise "Failed to fetch data from #{url}" unless response.status.success?

  parse(response.body.to_s)
end