Module: Geoblacklight::MetadataTransformer

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

Defined Under Namespace

Classes: Base, EmptyMetadataError, Fgdc, Iso19139, ParseError, TransformError, TypeError

Class Method Summary collapse

Class Method Details

.instance(metadata) ⇒ Geoblacklight::MetadataTransformer::BaseTransformer

Initialize a new MetadataTransformer instance

Parameters:

Returns:

  • (Geoblacklight::MetadataTransformer::BaseTransformer)


27
28
29
30
31
32
33
34
35
36
# File 'lib/geoblacklight/metadata_transformer.rb', line 27

def self.instance()
  type = .class.name.split("::").last
  begin
    klass = "Geoblacklight::MetadataTransformer::#{type.capitalize}".constantize
  rescue
    raise TypeError, "Metadata type #{type} is not supported"
  end

  klass.new()
end