Class: Geoblacklight::ItemViewer

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

Instance Method Summary collapse

Constructor Details

#initialize(references) ⇒ ItemViewer

Returns a new instance of ItemViewer.


3
4
5
# File 'lib/geoblacklight/item_viewer.rb', line 3

def initialize(references)
  @references = references
end

Instance Method Details

#iiifObject


21
22
23
# File 'lib/geoblacklight/item_viewer.rb', line 21

def iiif
  @references.iiif
end

#viewer_endpointObject


12
13
14
15
# File 'lib/geoblacklight/item_viewer.rb', line 12

def viewer_endpoint
  return '' if viewer_preference.nil?
  viewer_preference.values.first.to_s
end

#viewer_preferenceObject


25
26
27
# File 'lib/geoblacklight/item_viewer.rb', line 25

def viewer_preference
  [wms, iiif].compact.map(&:to_hash).first
end

#viewer_protocolObject


7
8
9
10
# File 'lib/geoblacklight/item_viewer.rb', line 7

def viewer_protocol
  return 'map' if viewer_preference.nil?
  viewer_preference.keys.first.to_s
end

#wmsObject


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

def wms
  @references.wms
end