Class: Geoblacklight::Reference
- Inherits:
-
Object
- Object
- Geoblacklight::Reference
- Defined in:
- lib/geoblacklight/reference.rb
Overview
Parses an array of dct_references to create useful reference information
Instance Attribute Summary collapse
-
#reference ⇒ Object
readonly
Returns the value of attribute reference.
Instance Method Summary collapse
-
#endpoint ⇒ String
The endpoint URL for a Geoblacklight::Reference.
-
#initialize(reference) ⇒ Reference
constructor
Initializes a Reference object using an Array.
-
#to_hash ⇒ Hash
Creates a hash, using its type as key and endpoint as value.
-
#type ⇒ Symbol
Lookups the type from the Constants::URI using the reference’s URI.
Constructor Details
#initialize(reference) ⇒ Reference
Initializes a Reference object using an Array
12 13 14 |
# File 'lib/geoblacklight/reference.rb', line 12 def initialize(reference) @reference = reference end |
Instance Attribute Details
#reference ⇒ Object (readonly)
Returns the value of attribute reference.
7 8 9 |
# File 'lib/geoblacklight/reference.rb', line 7 def reference @reference end |
Instance Method Details
#endpoint ⇒ String
The endpoint URL for a Geoblacklight::Reference
19 20 21 |
# File 'lib/geoblacklight/reference.rb', line 19 def endpoint @reference[1] end |
#to_hash ⇒ Hash
Creates a hash, using its type as key and endpoint as value
33 34 35 |
# File 'lib/geoblacklight/reference.rb', line 33 def to_hash {type => endpoint} end |
#type ⇒ Symbol
Lookups the type from the Constants::URI using the reference’s URI
26 27 28 |
# File 'lib/geoblacklight/reference.rb', line 26 def type Geoblacklight::Constants::URI.key(uri) end |