Class: GeoWorks::FileSetDerivativesService

Inherits:
Hyrax::FileSetDerivativesService
  • Object
show all
Defined in:
app/services/geo_works/file_set_derivatives_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_setObject (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.select_options.map(&:last)
    create_raster_derivatives(filename)
  when *GeoWorks::VectorFormatService.select_options.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

Returns:

  • (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