Class: RemoteTranslationLoader::Fetchers::S3Fetcher
- Inherits:
-
BaseFetcher
- Object
- BaseFetcher
- RemoteTranslationLoader::Fetchers::S3Fetcher
- Defined in:
- lib/remote_translation_loader/fetchers/s3_fetcher.rb
Instance Method Summary collapse
- #fetch(bucket, key) ⇒ Object
-
#initialize(s3_client = Aws::S3::Client.new) ⇒ S3Fetcher
constructor
A new instance of S3Fetcher.
Methods inherited from BaseFetcher
Constructor Details
#initialize(s3_client = Aws::S3::Client.new) ⇒ S3Fetcher
Returns a new instance of S3Fetcher.
8 9 10 |
# File 'lib/remote_translation_loader/fetchers/s3_fetcher.rb', line 8 def initialize(s3_client = Aws::S3::Client.new) @s3_client = s3_client end |
Instance Method Details
#fetch(bucket, key) ⇒ Object
12 13 14 15 |
# File 'lib/remote_translation_loader/fetchers/s3_fetcher.rb', line 12 def fetch(bucket, key) response = @s3_client.get_object(bucket: bucket, key: key) parse(response.body.read) end |