Sha256: 520fd6bcc22e6ef8de60b8ca028fd4168322acf8dfc402fa2c46086802d46276

Contents?: true

Size: 582 Bytes

Versions: 20

Compression:

Stored size: 582 Bytes

Contents

# frozen_string_literal: true
module Geoblacklight
  module Metadata
    ##
    # Initialize a new Metadata instance
    # @param [Geoblacklight::Reference] reference the reference for the metadata resource
    # @return [Geoblacklight::Metadata::Base]
    def self.instance(reference)
      begin
        klass = "Geoblacklight::Metadata::#{reference.type.capitalize}".constantize
      rescue
        Geoblacklight.logger.warn "Metadata type #{reference.type} is not supported"
        klass = Geoblacklight::Metadata::Base
      end

      klass.new(reference)
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
geoblacklight-3.8.1 lib/geoblacklight/metadata.rb
geoblacklight-3.8.0 lib/geoblacklight/metadata.rb
geoblacklight-4.0.0 lib/geoblacklight/metadata.rb
geoblacklight-4.0.0.pre.rc3 lib/geoblacklight/metadata.rb
geoblacklight-3.7.0 lib/geoblacklight/metadata.rb
geoblacklight-4.0.0.pre.rc2 lib/geoblacklight/metadata.rb
geoblacklight-4.0.0.pre.rc1 lib/geoblacklight/metadata.rb
geoblacklight-3.6.0 lib/geoblacklight/metadata.rb
geoblacklight-3.5.0 lib/geoblacklight/metadata.rb
geoblacklight-4.0.0.pre.alpha.3 lib/geoblacklight/metadata.rb
geoblacklight-4.0.0.pre.alpha.2 lib/geoblacklight/metadata.rb
geoblacklight-4.0.0.pre.alpha.1 lib/geoblacklight/metadata.rb
geoblacklight-4.0.0.pre.alpha lib/geoblacklight/metadata.rb
geoblacklight-3.4.0 lib/geoblacklight/metadata.rb
geoblacklight-3.3.1 lib/geoblacklight/metadata.rb
geoblacklight-3.3.0 lib/geoblacklight/metadata.rb
geoblacklight-3.2.0 lib/geoblacklight/metadata.rb
geoblacklight-3.1.0 lib/geoblacklight/metadata.rb
geoblacklight-3.0.1 lib/geoblacklight/metadata.rb
geoblacklight-3.0.0 lib/geoblacklight/metadata.rb