Sha256: 321c2bcbf75e42060aba5e3129f4b86359ce21125b74a68ea6a01551ddc5dc4c

Contents?: true

Size: 832 Bytes

Versions: 29

Compression:

Stored size: 832 Bytes

Contents

# -*- encoding : utf-8 -*-
# This module provides the body of an email export based on the document's semantic values
module Blacklight::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

29 entries across 29 versions & 1 rubygems

Version Path
blacklight-5.19.2 app/models/concerns/blacklight/document/email.rb
blacklight-5.19.1 app/models/concerns/blacklight/document/email.rb
blacklight-5.19.0 app/models/concerns/blacklight/document/email.rb
blacklight-5.18.0 app/models/concerns/blacklight/document/email.rb
blacklight-5.17.2 app/models/concerns/blacklight/document/email.rb
blacklight-5.17.1 app/models/concerns/blacklight/document/email.rb
blacklight-5.17.0 app/models/concerns/blacklight/document/email.rb
blacklight-5.16.4 app/models/concerns/blacklight/document/email.rb
blacklight-6.0.0.pre3 app/models/concerns/blacklight/document/email.rb
blacklight-5.16.3 app/models/concerns/blacklight/document/email.rb
blacklight-5.16.2 app/models/concerns/blacklight/document/email.rb
blacklight-5.16.1 app/models/concerns/blacklight/document/email.rb
blacklight-6.0.0.pre2 app/models/concerns/blacklight/document/email.rb
blacklight-6.0.0.pre1 app/models/concerns/blacklight/document/email.rb
blacklight-5.16.0 app/models/concerns/blacklight/document/email.rb
blacklight-5.15.0 lib/blacklight/document/email.rb
blacklight-5.14.0 lib/blacklight/document/email.rb
blacklight-5.13.1 lib/blacklight/document/email.rb
blacklight-5.13.0 lib/blacklight/document/email.rb
blacklight-5.11.3 lib/blacklight/document/email.rb