Class: RemoteTranslationLoader::Fetchers::FileFetcher

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

Instance Method Summary collapse

Methods inherited from BaseFetcher

#format_for, #parse

Instance Method Details

#fetch(path) ⇒ Object

Raises:



6
7
8
9
10
# File 'lib/remote_translation_loader/fetchers/file_fetcher.rb', line 6

def fetch(path)
  raise FetchError, "File not found: #{path}" unless File.exist?(path)

  parse(File.read(path), format: format_for(path))
end