Class: GeoWorks::FileSetDerivativesService
- Inherits:
-
Hyrax::FileSetDerivativesService
- Object
- Hyrax::FileSetDerivativesService
- GeoWorks::FileSetDerivativesService
- Defined in:
- app/services/geo_works/file_set_derivatives_service.rb
Instance Attribute Summary collapse
-
#file_set ⇒ Object
readonly
Returns the value of attribute file_set.
Instance Method Summary collapse
- #create_derivatives(filename) ⇒ Object
-
#initialize(file_set) ⇒ FileSetDerivativesService
constructor
A new instance of FileSetDerivativesService.
- #valid? ⇒ Boolean
Constructor Details
#initialize(file_set) ⇒ FileSetDerivativesService
Returns a new instance of FileSetDerivativesService.
6 7 8 |
# File 'app/services/geo_works/file_set_derivatives_service.rb', line 6 def initialize(file_set) @file_set = file_set end |
Instance Attribute Details
#file_set ⇒ Object (readonly)
Returns the value of attribute file_set.
3 4 5 |
# File 'app/services/geo_works/file_set_derivatives_service.rb', line 3 def file_set @file_set end |
Instance Method Details
#create_derivatives(filename) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/services/geo_works/file_set_derivatives_service.rb', line 14 def create_derivatives(filename) case geo_mime_type when *GeoWorks::RasterFormatService..map(&:last) create_raster_derivatives(filename) when *GeoWorks::VectorFormatService..map(&:last) create_vector_derivatives(filename) end # Once all the derivatives are created, send a created message geo_works_events_generator.derivatives_created(file_set) end |
#valid? ⇒ Boolean
10 11 12 |
# File 'app/services/geo_works/file_set_derivatives_service.rb', line 10 def valid? supported_geo_mime_types.include?(geo_mime_type) end |