Class: Spotlight::IiifResourceResolver

Inherits:
Object
  • Object
show all
Defined in:
app/services/spotlight/iiif_resource_resolver.rb

Overview

Update an ActiveRecord resource that containes identifiers for all the levels of an image resource described in a IIIF manifest

Defined Under Namespace

Classes: ManifestError

Instance Method Summary collapse

Constructor Details

#initialize(resource) ⇒ IiifResourceResolver

Returns a new instance of IiifResourceResolver.



8
9
10
# File 'app/services/spotlight/iiif_resource_resolver.rb', line 8

def initialize(resource)
  @resource = resource
end

Instance Method Details

#resolve!Object



12
13
14
15
16
# File 'app/services/spotlight/iiif_resource_resolver.rb', line 12

def resolve!
  resource.iiif_tilesource = updated_tilesource
  return resource.save if resource.changed?
  Rails.logger.info("#{self.class.name} resolved #{iiif_manifest_url}, but nothing changed.")
end