Class: Geoblacklight::Metadata::Base
- Inherits:
-
Object
- Object
- Geoblacklight::Metadata::Base
- Defined in:
- lib/geoblacklight/metadata/base.rb
Overview
Abstract Class for metadata
Instance Attribute Summary collapse
-
#reference ⇒ Object
readonly
Returns the value of attribute reference.
Instance Method Summary collapse
-
#blank? ⇒ Boolean
Determines whether or not a metadata resources is empty.
-
#document ⇒ Nokogiri::XML::Document
Retrieves the XML Document for the metadata.
-
#endpoint ⇒ String?
Retrieves the URI for the reference resource (e. g. a service endpoint).
-
#initialize(reference) ⇒ Base
constructor
Instantiates a Geoblacklight::Metadata object used for retrieving and formatting metadata.
Constructor Details
#initialize(reference) ⇒ Base
Instantiates a Geoblacklight::Metadata object used for retrieving and formatting metadata
19 20 21 |
# File 'lib/geoblacklight/metadata/base.rb', line 19 def initialize(reference) @reference = reference end |
Instance Attribute Details
#reference ⇒ Object (readonly)
Returns the value of attribute reference.
9 10 11 |
# File 'lib/geoblacklight/metadata/base.rb', line 9 def reference @reference end |
Instance Method Details
#blank? ⇒ Boolean
Determines whether or not a metadata resources is empty
33 34 35 |
# File 'lib/geoblacklight/metadata/base.rb', line 33 def blank? document.nil? || document.children.empty? end |
#document ⇒ Nokogiri::XML::Document
Retrieves the XML Document for the metadata
26 27 28 |
# File 'lib/geoblacklight/metadata/base.rb', line 26 def document @document ||= . end |
#endpoint ⇒ String?
Retrieves the URI for the reference resource (e. g. a service endpoint)
40 41 42 |
# File 'lib/geoblacklight/metadata/base.rb', line 40 def endpoint blank? ? nil : @reference.endpoint end |