Class: Riiif::FileSystemFileResolver

Inherits:
AbstractFileSystemResolver show all
Defined in:
app/resolvers/riiif/file_system_file_resolver.rb

Instance Attribute Summary collapse

Attributes inherited from AbstractFileSystemResolver

#base_path

Instance Method Summary collapse

Methods inherited from AbstractFileSystemResolver

#find, #initialize, #path

Constructor Details

This class inherits a constructor from Riiif::AbstractFileSystemResolver

Instance Attribute Details

#input_types=(value) ⇒ Object

Sets the attribute input_types

Parameters:

  • value

    the value to set the attribute input_types to.



3
4
5
# File 'app/resolvers/riiif/file_system_file_resolver.rb', line 3

def input_types=(value)
  @input_types = value
end

Instance Method Details

#pattern(id) ⇒ Object

Returns a string suitable for a globbing match e.g. /base/path/67352ccc-d1b0-11e1-89ae-279075081939.jp2,tiff,png or nil when the id is not valid.

Returns:

  • a string suitable for a globbing match e.g. /base/path/67352ccc-d1b0-11e1-89ae-279075081939.jp2,tiff,png or nil when the id is not valid



8
9
10
11
# File 'app/resolvers/riiif/file_system_file_resolver.rb', line 8

def pattern(id)
  return unless validate_identifier(id: id)
  ::File.join(base_path, "#{id}.{#{input_types.join(',')}}")
end