Sha256: e57cfc97355f9cdccbd236fee36ae5993422c98c810fb1f7214fa731ce37f29a
Contents?: true
Size: 559 Bytes
Versions: 6
Compression:
Stored size: 559 Bytes
Contents
module Riiif class AbstractFileSystemResolver extend Deprecation attr_accessor :base_path def initialize(base_path: nil) @base_path = base_path end def find(id) Riiif::File.new(path(id)) end # @param [String] id the id to resolve # @return the path of the file def path(id) search = pattern(id) search && Dir.glob(search).first || raise(ImageNotFoundError, search) end def pattern(_id) raise NotImplementedError, "Implement `pattern(id)' in the concrete class" end end end
Version data entries
6 entries across 6 versions & 2 rubygems