Module: Spotlight::RiiifService

Defined in:
lib/spotlight/riiif_service.rb

Overview

iiif_service module for when using the built-in riiif server

Class Method Summary collapse

Class Method Details

.info(id) ⇒ Hash

Parameters:

  • id (String)

    the ID string of a Spotlight::FeaturedImage

Returns:

  • (Hash)


27
28
29
# File 'lib/spotlight/riiif_service.rb', line 27

def self.info(id)
  Riiif::Image.new(id).info
end

.info_url(image, _host = nil) ⇒ String

Parameters:

Returns:

  • (String)


14
15
16
# File 'lib/spotlight/riiif_service.rb', line 14

def self.info_url(image, _host = nil)
  Riiif::Engine.routes.url_helpers.info_path(image)
end

.manifest_url(exhibit, resource) ⇒ String

Parameters:

Returns:

  • (String)


21
22
23
# File 'lib/spotlight/riiif_service.rb', line 21

def self.manifest_url(exhibit, resource)
  Spotlight::Engine.routes.url_helpers.manifest_exhibit_solr_document_path(exhibit, "#{exhibit.id}-#{resource.id}")
end

.thumbnail_url(image) ⇒ String

Parameters:

Returns:

  • (String)


8
9
10
# File 'lib/spotlight/riiif_service.rb', line 8

def self.thumbnail_url(image)
  Riiif::Engine.routes.url_helpers.image_path(image, size: '!400,400')
end