Module: Spotlight::SolrDocument::UploadedResource

Extended by:
ActiveSupport::Concern
Defined in:
app/models/concerns/spotlight/solr_document/uploaded_resource.rb

Defined Under Namespace

Classes: LegacyImagePyramidTileSource

Instance Method Summary collapse

Instance Method Details

#to_openseadragon(*args) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'app/models/concerns/spotlight/solr_document/uploaded_resource.rb', line 12

def to_openseadragon(*args)
  self[Spotlight::Engine.config.full_image_field].each_with_index.map do |image_url, index|
    {LegacyImagePyramidTileSource.new(
       image_url,
       {width: self[:spotlight_full_image_width_ssm][index],
        height: self[:spotlight_full_image_height_ssm][index]}
     ) => {}
    } 
  end
end

#uploaded_resourceObject



8
9
10
# File 'app/models/concerns/spotlight/solr_document/uploaded_resource.rb', line 8

def uploaded_resource
  @uploaded_resource ||= GlobalID::Locator.locate first(Spotlight::Resource.resource_global_id_field) rescue nil
end