Sha256: 7f14cad9e248b82d5811d8356e92f2dc8fcf6b69dd59606e918f39855f86c94a

Contents?: true

Size: 926 Bytes

Versions: 3

Compression:

Stored size: 926 Bytes

Contents

module NewspaperWorks::Solr::Document
  SOLR_NAMES = %w[alternative_title genre place_of_publication
                  issn lccn oclcnum held_by text_direction
                  page_number section author photographer
                  volume issue_number geographic_coverage
                  extent publication_date height width
                  edition_number edition_name frequency preceded_by
                  succeeded_by publication_date_start
                  publication_date_end].freeze

  def method_missing(m, *args, &block)
    super unless SOLR_NAMES.include? m.to_s
    self[Solrizer.solr_name(m.to_s)]
  end

  def respond_to_missing?(method_name, include_private = false)
    SOLR_NAMES.include?(method_name.to_s) || super
  end

  # TODO: figure out if there is a cleaner way to get this
  #       adding file_set_ids to SOLR_NAMES does not work
  def file_set_ids
    self['file_set_ids_ssim']
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
newspaper_works-1.0.1 app/models/concerns/newspaper_works/solr/document.rb
newspaper_works-1.0.0 app/models/concerns/newspaper_works/solr/document.rb
newspaper_works-0.1.0 app/models/concerns/newspaper_works/solr/document.rb