Class: Pageflow::Panorama::UnpackToS3
- Inherits:
-
Object
- Object
- Pageflow::Panorama::UnpackToS3
- Defined in:
- lib/pageflow/panorama/unpack_to_s3.rb
Instance Attribute Summary collapse
-
#archive ⇒ Object
readonly
Returns the value of attribute archive.
-
#content_type_mapping ⇒ Object
readonly
Returns the value of attribute content_type_mapping.
-
#destination_base_path ⇒ Object
readonly
Returns the value of attribute destination_base_path.
-
#destination_bucket ⇒ Object
readonly
Returns the value of attribute destination_bucket.
Instance Method Summary collapse
-
#initialize(archive:, destination_bucket:, destination_base_path:, content_type_mapping: {}) ⇒ UnpackToS3
constructor
A new instance of UnpackToS3.
- #upload {|100| ... } ⇒ Object
Constructor Details
#initialize(archive:, destination_bucket:, destination_base_path:, content_type_mapping: {}) ⇒ UnpackToS3
Returns a new instance of UnpackToS3.
8 9 10 11 12 13 |
# File 'lib/pageflow/panorama/unpack_to_s3.rb', line 8 def initialize(archive:, destination_bucket:, destination_base_path:, content_type_mapping: {}) @archive = archive @destination_bucket = destination_bucket @destination_base_path = destination_base_path @content_type_mapping = content_type_mapping end |
Instance Attribute Details
#archive ⇒ Object (readonly)
Returns the value of attribute archive.
6 7 8 |
# File 'lib/pageflow/panorama/unpack_to_s3.rb', line 6 def archive @archive end |
#content_type_mapping ⇒ Object (readonly)
Returns the value of attribute content_type_mapping.
6 7 8 |
# File 'lib/pageflow/panorama/unpack_to_s3.rb', line 6 def content_type_mapping @content_type_mapping end |
#destination_base_path ⇒ Object (readonly)
Returns the value of attribute destination_base_path.
6 7 8 |
# File 'lib/pageflow/panorama/unpack_to_s3.rb', line 6 def destination_base_path @destination_base_path end |
#destination_bucket ⇒ Object (readonly)
Returns the value of attribute destination_bucket.
6 7 8 |
# File 'lib/pageflow/panorama/unpack_to_s3.rb', line 6 def destination_bucket @destination_bucket end |
Instance Method Details
#upload {|100| ... } ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/pageflow/panorama/unpack_to_s3.rb', line 15 def upload archive.entries.each_with_index do |entry, index| yield(100.0 * index / archive.entries.size) if block_given? upload_entry(entry) end yield(100) if block_given? end |