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.



10
11
12
# File 'app/services/spotlight/iiif_resource_resolver.rb', line 10

def initialize(resource)
  @resource = resource
end

Instance Method Details

#resolve!Object



14
15
16
17
18
19
# File 'app/services/spotlight/iiif_resource_resolver.rb', line 14

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