class Geoblacklight::Reference

Parses an array of dct_references to create useful reference information

Attributes

reference[R]

Public Class Methods

new(reference) click to toggle source

Initializes a Reference object using an Array @param [Array] reference

# File lib/geoblacklight/reference.rb, line 12
def initialize(reference)
  @reference = reference
end

Public Instance Methods

endpoint() click to toggle source

The endpoint URL for a Geoblacklight::Reference @return [String]

# File lib/geoblacklight/reference.rb, line 19
def endpoint
  @reference[1]
end
to_hash() click to toggle source

Creates a hash, using its type as key and endpoint as value @return [Hash]

# File lib/geoblacklight/reference.rb, line 33
def to_hash
  {type => endpoint}
end
type() click to toggle source

Lookups the type from the Constants::URI using the reference’s URI @return [Symbol]

# File lib/geoblacklight/reference.rb, line 26
def type
  Geoblacklight::Constants::URI.key(uri)
end

Private Instance Methods

uri() click to toggle source

The URI used for this instance’s creation Remove any trailing slashes @return [String]

# File lib/geoblacklight/reference.rb, line 43
def uri
  @reference[0].sub(/(\/)+$/, "") if @reference[0].present?
end