Class: Geoblacklight::MetadataTransformer::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/geoblacklight/metadata_transformer/base.rb

Overview

Abstract class for transforming geospatial metadata

Direct Known Subclasses

Fgdc, Iso19139

Instance Method Summary collapse

Constructor Details

#initialize(metadata) ⇒ Base

Returns a new instance of Base.

Parameters:

  • metadata (GeoCombine::Metadata)

    metadata Object

See Also:

  • GeoCombine::Metadata


11
12
13
14
15
# File 'lib/geoblacklight/metadata_transformer/base.rb', line 11

def initialize()
  @metadata = 
  # Access the Nokogiri::XML Document from the metadata Object
  fail EmptyMetadataError, "Failed to retrieve the metadata" if @metadata.blank?
end

Instance Method Details

#transformString

Returns HTML for the metadata transformed into HTML using GeoCombine

Returns:

  • (String)

    the transformed metadata in the HTML

See Also:

  • GeoCombine::Metadata#to_html


21
22
23
24
25
# File 'lib/geoblacklight/metadata_transformer/base.rb', line 21

def transform
  .to_html
rescue => e
  raise TransformError, e.message
end