Class: Geoblacklight::Reference

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

Overview

Parses an array of dct_references to create useful reference information

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(reference) ⇒ Reference

Initializes a Reference object using an Array

Parameters:

  • reference (Array)


10
11
12
# File 'lib/geoblacklight/reference.rb', line 10

def initialize(reference)
  @reference = reference
end

Instance Attribute Details

#referenceObject (readonly)

Returns the value of attribute reference.



5
6
7
# File 'lib/geoblacklight/reference.rb', line 5

def reference
  @reference
end

Instance Method Details

#endpointString

The endpoint URL for a Geoblacklight::Reference

Returns:

  • (String)


17
18
19
# File 'lib/geoblacklight/reference.rb', line 17

def endpoint
  @reference[1]
end

#to_hashHash

Creates a hash, using its type as key and endpoint as value

Returns:

  • (Hash)


31
32
33
# File 'lib/geoblacklight/reference.rb', line 31

def to_hash
  { type => endpoint }
end

#typeSymbol

Lookups the type from the Constants::URI using the reference’s URI

Returns:

  • (Symbol)


24
25
26
# File 'lib/geoblacklight/reference.rb', line 24

def type
  Geoblacklight::Constants::URI.key(uri)
end