Sha256: 13abb378576697091200c972009e36f2f10c0d7a33cfbf1a6b9104161b41725a

Contents?: true

Size: 850 Bytes

Versions: 6

Compression:

Stored size: 850 Bytes

Contents

# -*- encoding : utf-8 -*-
# This module provides the body of an email export based on the document's semantic values
module Blacklight::Solr::Document::Email

  # Return a text string that will be the body of the email
  def to_email_text
    semantics = self.to_semantic_values
    body = []
    body << I18n.t('blacklight.email.text.title', :value => semantics[:title].join(" ")) unless semantics[:title].blank?
    body << I18n.t('blacklight.email.text.author', :value => semantics[:author].join(" ")) unless semantics[:author].blank?
    body << I18n.t('blacklight.email.text.format', :value => semantics[:format].join(" ")) unless semantics[:format].blank?
    body << I18n.t('blacklight.email.text.language', :value => semantics[:language].join(" ")) unless semantics[:language].blank?
    return body.join("\n") unless body.empty?
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
blacklight-5.9.4 lib/blacklight/solr/document/email.rb
blacklight-5.9.3 lib/blacklight/solr/document/email.rb
blacklight-5.9.2 lib/blacklight/solr/document/email.rb
blacklight-5.9.1 lib/blacklight/solr/document/email.rb
blacklight-5.9.0 lib/blacklight/solr/document/email.rb
blacklight-5.8.2 lib/blacklight/solr/document/email.rb