Class: Riiif::FileSystemFileResolver
- Inherits:
-
AbstractFileSystemResolver
- Object
- AbstractFileSystemResolver
- Riiif::FileSystemFileResolver
- Defined in:
- app/resolvers/riiif/file_system_file_resolver.rb
Instance Attribute Summary collapse
-
#input_types ⇒ Object
writeonly
Sets the attribute input_types.
Attributes inherited from AbstractFileSystemResolver
Instance Method Summary collapse
-
#pattern(id) ⇒ Object
A string suitable for a globbing match e.g.
Methods inherited from AbstractFileSystemResolver
Constructor Details
This class inherits a constructor from Riiif::AbstractFileSystemResolver
Instance Attribute Details
#input_types=(value) ⇒ Object
Sets the attribute input_types
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.
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 |