Class: Backy::S3List

Inherits:
Object
  • Object
show all
Includes:
S3
Defined in:
lib/backy/s3_list.rb

Instance Method Summary collapse

Instance Method Details

#callObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/backy/s3_list.rb', line 5

def call
  return [] unless s3_configured?

  response = s3.list_objects(prefix: prefix, bucket: bucket)

  result = response.contents.map(&:key)

  while response.next_page?
    response = response.next_page

    result += response.contents.map(&:key)
  end

  result.sort
end