Class: Pageflow::Panorama::Package
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Pageflow::Panorama::Package
- Includes:
- HostedFile
- Defined in:
- app/models/pageflow/panorama/package.rb
Instance Method Summary collapse
- #archive ⇒ Object
- #index_document_path ⇒ Object
- #keep_on_filesystem_after_upload_to_s3? ⇒ Boolean
- #thumbnail_url(*args) ⇒ Object
- #unpack_base_path ⇒ Object
- #unpacker ⇒ Object
Instance Method Details
#archive ⇒ Object
52 53 54 |
# File 'app/models/pageflow/panorama/package.rb', line 52 def archive @archive ||= Zip::File.open(.path) end |
#index_document_path ⇒ Object
46 47 48 49 50 |
# File 'app/models/pageflow/panorama/package.rb', line 46 def index_document_path if .present? && index_document File.join(Panorama.config.packages_base_path, unpack_base_path, index_document) end end |
#keep_on_filesystem_after_upload_to_s3? ⇒ Boolean
34 35 36 |
# File 'app/models/pageflow/panorama/package.rb', line 34 def keep_on_filesystem_after_upload_to_s3? true end |
#thumbnail_url(*args) ⇒ Object
38 39 40 |
# File 'app/models/pageflow/panorama/package.rb', line 38 def thumbnail_url(*args) thumbnail.url(*args) end |
#unpack_base_path ⇒ Object
42 43 44 |
# File 'app/models/pageflow/panorama/package.rb', line 42 def unpack_base_path .present? ? File.dirname(.path(:unpacked)) : nil end |
#unpacker ⇒ Object
56 57 58 59 60 |
# File 'app/models/pageflow/panorama/package.rb', line 56 def unpacker UnpackToS3.new(archive: archive, destination_bucket: .s3_bucket, destination_base_path: unpack_base_path) end |