Sha256: d0f5c5248e45b01dab60556c881b8e4a3c4e8687f0c92b64a494342664f0edbe

Contents?: true

Size: 833 Bytes

Versions: 31

Compression:

Stored size: 833 Bytes

Contents

# frozen_string_literal: true
# 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

31 entries across 31 versions & 1 rubygems

Version Path
blacklight-6.25.0 app/models/concerns/blacklight/document/email.rb
blacklight-6.24.0 app/models/concerns/blacklight/document/email.rb
blacklight-6.23.0 app/models/concerns/blacklight/document/email.rb
blacklight-6.22.0 app/models/concerns/blacklight/document/email.rb
blacklight-6.21.0 app/models/concerns/blacklight/document/email.rb
blacklight-6.20.0 app/models/concerns/blacklight/document/email.rb
blacklight-6.19.2 app/models/concerns/blacklight/document/email.rb
blacklight-6.19.1 app/models/concerns/blacklight/document/email.rb
blacklight-6.19.0 app/models/concerns/blacklight/document/email.rb
blacklight-6.18.0 app/models/concerns/blacklight/document/email.rb
blacklight-6.17.0 app/models/concerns/blacklight/document/email.rb
blacklight-6.16.0 app/models/concerns/blacklight/document/email.rb
blacklight-6.15.0 app/models/concerns/blacklight/document/email.rb
blacklight-6.14.1 app/models/concerns/blacklight/document/email.rb
blacklight-6.14.0 app/models/concerns/blacklight/document/email.rb
blacklight-6.13.0 app/models/concerns/blacklight/document/email.rb
blacklight-6.12.0 app/models/concerns/blacklight/document/email.rb
blacklight-6.11.2 app/models/concerns/blacklight/document/email.rb
blacklight-6.11.1 app/models/concerns/blacklight/document/email.rb
blacklight-6.11.0 app/models/concerns/blacklight/document/email.rb