Module: GeoConcerns::SolrDocumentBehavior

Extended by:
ActiveSupport::Concern
Includes:
CurationConcerns::SolrDocumentBehavior
Defined in:
app/models/concerns/geo_concerns/solr_document_behavior.rb

Instance Method Summary collapse

Instance Method Details

#coverageString

Returns:

  • (String)


22
23
24
# File 'app/models/concerns/geo_concerns/solr_document_behavior.rb', line 22

def coverage
  fetch(Solrizer.solr_name('coverage'), nil)
end

#identifierArray<String>

Returns:

  • (Array<String>)


42
43
44
# File 'app/models/concerns/geo_concerns/solr_document_behavior.rb', line 42

def identifier
  fetch(Solrizer.solr_name('identifier'), [])
end

#issuedString

Returns:

  • (String)


17
18
19
# File 'app/models/concerns/geo_concerns/solr_document_behavior.rb', line 17

def issued
  fetch(Solrizer.solr_name('issued'), nil)
end

#layer_modifiedDateTime

Returns:

  • (DateTime)


34
35
36
37
38
39
# File 'app/models/concerns/geo_concerns/solr_document_behavior.rb', line 34

def layer_modified
  # TODO: `date_modified` isn't working correctly -- it's stored as a string not a date
  # @see 'https://github.com/projecthydra/curation_concerns/issues/957'
  dt = first(Solrizer.solr_name('system_modified', :stored_sortable, type: :date))
  dt.nil? ? nil : DateTime.parse(dt).utc
end

#provenanceString

Returns:

  • (String)

Raises:

  • (ArgumentError)


27
28
29
30
31
# File 'app/models/concerns/geo_concerns/solr_document_behavior.rb', line 27

def provenance
  name = I18n.t('curation_concerns.institution.name')
  raise ArgumentError, "Provenance required in configuration" unless name.present?
  name
end

#spatialArray<String>

Returns:

  • (Array<String>)


7
8
9
# File 'app/models/concerns/geo_concerns/solr_document_behavior.rb', line 7

def spatial
  fetch(Solrizer.solr_name('spatial'), [])
end

#temporalArray<String>

Returns:

  • (Array<String>)


12
13
14
# File 'app/models/concerns/geo_concerns/solr_document_behavior.rb', line 12

def temporal
  fetch(Solrizer.solr_name('temporal'), [])
end