Class: GeoConcerns::Discovery::DocumentBuilder::DocumentPath
- Inherits:
-
Object
- Object
- GeoConcerns::Discovery::DocumentBuilder::DocumentPath
- Defined in:
- app/services/geo_concerns/discovery/document_builder/document_path.rb
Instance Attribute Summary collapse
-
#geo_concern ⇒ Object
readonly
Returns the value of attribute geo_concern.
Instance Method Summary collapse
-
#file_download ⇒ String
Returns url for downloading the original file.
-
#initialize(geo_concern) ⇒ DocumentPath
constructor
A new instance of DocumentPath.
-
#metadata_download(format) ⇒ String
Returns url for downloading the metadata file.
-
#thumbnail ⇒ String
Returns url for thumbnail image.
-
#to_s ⇒ String
Returns url for geo concern show page.
Constructor Details
#initialize(geo_concern) ⇒ DocumentPath
Returns a new instance of DocumentPath.
6 7 8 |
# File 'app/services/geo_concerns/discovery/document_builder/document_path.rb', line 6 def initialize(geo_concern) @geo_concern = geo_concern end |
Instance Attribute Details
#geo_concern ⇒ Object (readonly)
Returns the value of attribute geo_concern.
5 6 7 |
# File 'app/services/geo_concerns/discovery/document_builder/document_path.rb', line 5 def geo_concern @geo_concern end |
Instance Method Details
#file_download ⇒ String
Returns url for downloading the original file.
18 19 20 21 |
# File 'app/services/geo_concerns/discovery/document_builder/document_path.rb', line 18 def file_download return unless file_set helper.download_url(file_set, host: host, protocol: protocol) end |
#metadata_download(format) ⇒ String
Returns url for downloading the metadata file.
26 27 28 29 30 31 |
# File 'app/services/geo_concerns/discovery/document_builder/document_path.rb', line 26 def (format) return unless path = helper.download_url(, host: host, protocol: protocol) mime_type = .solr_document[:geo_mime_type_ssim].first path if MetadataFormatService.label(mime_type) == format end |
#thumbnail ⇒ String
Returns url for thumbnail image.
35 36 37 38 |
# File 'app/services/geo_concerns/discovery/document_builder/document_path.rb', line 35 def thumbnail return unless file_download "#{file_download}?file=thumbnail" end |
#to_s ⇒ String
Returns url for geo concern show page.
12 13 14 |
# File 'app/services/geo_concerns/discovery/document_builder/document_path.rb', line 12 def to_s helper.polymorphic_url(geo_concern, host: host, protocol: protocol) end |