Sha256: 0ce7b4f5414e2afae4f14d7e410f9f1042f919fb344e8f86e311d9a490513b03

Contents?: true

Size: 847 Bytes

Versions: 58

Compression:

Stored size: 847 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.title', :value => semantics[:title].join(" ")) unless semantics[:title].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

58 entries across 58 versions & 1 rubygems

Version Path
blacklight-4.9.0 lib/blacklight/solr/document/email.rb
blacklight-4.8.0 lib/blacklight/solr/document/email.rb
blacklight-5.8.1 lib/blacklight/solr/document/email.rb
blacklight-5.8.0 lib/blacklight/solr/document/email.rb
blacklight-5.7.2 lib/blacklight/solr/document/email.rb
blacklight-5.5.4 lib/blacklight/solr/document/email.rb
blacklight-5.7.1 lib/blacklight/solr/document/email.rb
blacklight-5.7.0 lib/blacklight/solr/document/email.rb
blacklight-5.6.0 lib/blacklight/solr/document/email.rb
blacklight-5.5.3 lib/blacklight/solr/document/email.rb
blacklight-5.5.2 lib/blacklight/solr/document/email.rb
blacklight-5.5.1 lib/blacklight/solr/document/email.rb
blacklight-5.5.0 lib/blacklight/solr/document/email.rb
blacklight-5.4.0 lib/blacklight/solr/document/email.rb
blacklight-5.4.0.rc1 lib/blacklight/solr/document/email.rb
blacklight-5.3.0 lib/blacklight/solr/document/email.rb
blacklight-5.0.3 lib/blacklight/solr/document/email.rb
blacklight-5.1.1 lib/blacklight/solr/document/email.rb
blacklight-5.2.0 lib/blacklight/solr/document/email.rb
blacklight-5.1.0 lib/blacklight/solr/document/email.rb