Sha256: 376997aae9967da85e8a964949006f75ae462bb54c32c37a195f06adbbc28881

Contents?: true

Size: 697 Bytes

Versions: 17

Compression:

Stored size: 697 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 << "Title: #{semantics[:title].join(" ")}\n" unless semantics[:title].blank?
    body << "Author: #{semantics[:author].join(" ")}\n" unless semantics[:author].blank?
    body << "Format: #{semantics[:format].join(" ")}\n" unless semantics[:format].blank?
    body << "Language: #{semantics[:language].join(" ")}" unless semantics[:language].blank?
    return body unless body.blank?
  end

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
blacklight-3.4.2 lib/blacklight/solr/document/email.rb
blacklight-3.4.1 lib/blacklight/solr/document/email.rb
blacklight-3.4.0 lib/blacklight/solr/document/email.rb
blacklight-3.3.2 lib/blacklight/solr/document/email.rb
blacklight-3.3.1 lib/blacklight/solr/document/email.rb
blacklight-3.3.0 lib/blacklight/solr/document/email.rb
blacklight-3.2.2 lib/blacklight/solr/document/email.rb
blacklight-3.2.1 lib/blacklight/solr/document/email.rb
blacklight-3.2.0 lib/blacklight/solr/document/email.rb
blacklight-3.2.0pre2 lib/blacklight/solr/document/email.rb
blacklight-3.2.0pre1 lib/blacklight/solr/document/email.rb
blacklight-3.1.2 lib/blacklight/solr/document/email.rb
blacklight-3.1.1 lib/blacklight/solr/document/email.rb
blacklight-3.1.0 lib/blacklight/solr/document/email.rb
blacklight-3.0.0 lib/blacklight/solr/document/email.rb
blacklight-3.0.0pre8 lib/blacklight/solr/document/email.rb
blacklight-3.0.0pre7 lib/blacklight/solr/document/email.rb