Class: RemoteTranslationLoader::Fetchers::BaseFetcher

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

Direct Known Subclasses

FileFetcher, HttpFetcher, S3Fetcher

Instance Method Summary collapse

Instance Method Details

#fetch(_source) ⇒ Object

Raises:

  • (NotImplementedError)


6
7
8
# File 'lib/remote_translation_loader/fetchers/base_fetcher.rb', line 6

def fetch(_source)
  raise NotImplementedError, "Subclasses must implement the `fetch` method"
end

#parse(content) ⇒ Object



10
11
12
13
14
# File 'lib/remote_translation_loader/fetchers/base_fetcher.rb', line 10

def parse(content)
  YAML.safe_load(content)
rescue Psych::SyntaxError => e
  raise "Failed to parse content: #{e.message}"
end