class Ggggsss::S3Fetcher

Attributes

objects[R]

Public Class Methods

new(bucket_name, path) click to toggle source
# File lib/ggggsss.rb, line 49
def initialize(bucket_name, path)
  @bucket_name = bucket_name
  @path = path
  @objects = []
end

Public Instance Methods

fetch!() click to toggle source
# File lib/ggggsss.rb, line 55
def fetch!
  s3 = Aws::S3::Resource.new
  bucket = s3.bucket(@bucket_name)
  bucket.objects(prefix: @path).each do |object_summary|
    object_output = object_summary.get
    @objects << S3Object.new(key: object_summary.key, body: object_output.body)
  end
end