Class: Geoblacklight::Metadata::Base

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

Overview

Abstract Class for metadata

Direct Known Subclasses

Fgdc, Html, Iso19139

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(reference) ⇒ Base

Instantiates a Geoblacklight::Metadata object used for retrieving and formatting metadata

Parameters:



16
17
18
# File 'lib/geoblacklight/metadata/base.rb', line 16

def initialize(reference)
  @reference = reference
end

Instance Attribute Details

#referenceObject (readonly)

Returns the value of attribute reference.



6
7
8
# File 'lib/geoblacklight/metadata/base.rb', line 6

def reference
  @reference
end

Instance Method Details

#blank?Boolean

Determines whether or not a metadata resources is empty

Returns:

  • (Boolean)


30
31
32
# File 'lib/geoblacklight/metadata/base.rb', line 30

def blank?
  document.nil? || document.children.empty?
end

#documentNokogiri::XML::Document

Retrieves the XML Document for the metadata

Returns:

  • (Nokogiri::XML::Document)


23
24
25
# File 'lib/geoblacklight/metadata/base.rb', line 23

def document
  @document ||= .
end

#endpointString?

Retrieves the URI for the reference resource (e. g. a service endpoint)

Returns:

  • (String, nil)


37
38
39
# File 'lib/geoblacklight/metadata/base.rb', line 37

def endpoint
  blank? ? nil : @reference.endpoint
end