Class: GeoWorks::Discovery::GeoblacklightDocument

Inherits:
AbstractDocument show all
Defined in:
app/services/geo_works/discovery/geoblacklight_document.rb

Overview

For details on the schema,

Instance Attribute Summary

Attributes inherited from AbstractDocument

#access_rights, #creator, #dct_references, #description, #download, #fgdc, #format, #geom_type, #identifier, #iso19139, #issued, #language, #layer_modified, #layer_year, #mods, #provenance, #publisher, #resource_type, #slug, #solr_coverage, #spatial, #subject, #temporal, #thumbnail, #title, #url, #wfs_path, #wms_path, #wxs_identifier

Instance Method Summary collapse

Methods inherited from AbstractDocument

#clean_document, #to_xml

Instance Method Details

#to_hash(_args = nil) ⇒ Hash

Implements the to_hash method on the abstract document.

Parameters:

  • _args (Array<Object>) (defaults to: nil)

    arguments needed for the renderer, unused here

Returns:

  • (Hash)

    geoblacklight document as a hash



12
13
14
15
# File 'app/services/geo_works/discovery/geoblacklight_document.rb', line 12

def to_hash(_args = nil)
  return {} unless rights
  document
end

#to_json(_args = nil) ⇒ String

Implements the to_json method on the abstract document.

Parameters:

  • _args (Array<Object>) (defaults to: nil)

    arguments needed for the json renderer, unused here

Returns:

  • (String)

    geoblacklight document as a json string



20
21
22
23
# File 'app/services/geo_works/discovery/geoblacklight_document.rb', line 20

def to_json(_args = nil)
  return '{}' unless rights
  document.to_json
end