Module: Geoblacklight::Metadata

Defined in:
lib/geoblacklight/metadata.rb,
lib/geoblacklight/metadata/base.rb,
lib/geoblacklight/metadata/fgdc.rb,
lib/geoblacklight/metadata/html.rb,
lib/geoblacklight/metadata/iso19139.rb

Defined Under Namespace

Classes: Base, Fgdc, Html, Iso19139

Class Method Summary collapse

Class Method Details

.instance(reference) ⇒ Geoblacklight::Metadata::Base

Initialize a new Metadata instance

Parameters:

Returns:



9
10
11
12
13
14
15
16
17
18
# File 'lib/geoblacklight/metadata.rb', line 9

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