Module: Blacklight::Solr::Document::Email

Defined in:
lib/blacklight/solr/document/email.rb

Overview

This module provides the body of an email export based on the document's semantic values

Instance Method Summary (collapse)

Instance Method Details

- (Object) to_email_text

Return a text string that will be the body of the email



6
7
8
9
10
11
12
13
14
# File 'lib/blacklight/solr/document/email.rb', line 6

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