Sha256: caf7f625f03ee2f67ca6e0c80c5a8eedeefd4e02b1b55bd00236f30ec33bf256

Contents?: true

Size: 691 Bytes

Versions: 14

Compression:

Stored size: 691 Bytes

Contents

# encoding: utf-8
# frozen_string_literal: true
require 'mail/fields/named_structured_field'
require 'mail/utilities'

module Mail
  class ContentIdField < NamedStructuredField #:nodoc:
    NAME = 'Content-ID'

    def self.singular?
      true
    end

    def initialize(value = nil, charset = nil)
      value = Mail::Utilities.generate_message_id if Utilities.blank?(value)
      super value, charset
    end

    def element
      @element ||= Mail::MessageIdsElement.new(value)
    end

    def content_id
      element.message_id
    end

    private
      def do_decode
        "<#{content_id}>"
      end

      def do_encode
        "#{name}: #{do_decode}\r\n"
      end
  end
end

Version data entries

14 entries across 14 versions & 5 rubygems

Version Path
minato_ruby_api_client-0.2.2 vendor/bundle/ruby/3.2.0/gems/mail-2.8.1/lib/mail/fields/content_id_field.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/mail-2.8.1/lib/mail/fields/content_id_field.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/mail-2.8.1/lib/mail/fields/content_id_field.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/mail-2.8.1/lib/mail/fields/content_id_field.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/mail-2.8.1/lib/mail/fields/content_id_field.rb
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/mail-2.8.1/lib/mail/fields/content_id_field.rb
mail-2.8.1 lib/mail/fields/content_id_field.rb
mail-2.8.1.rc2 lib/mail/fields/content_id_field.rb
mail-2.8.0.1 lib/mail/fields/content_id_field.rb
mail-2.8.0.1.rc1 lib/mail/fields/content_id_field.rb
mail-2.8.0 lib/mail/fields/content_id_field.rb
mail-2.8.0.rc3 lib/mail/fields/content_id_field.rb
mail-2.8.0.rc2 lib/mail/fields/content_id_field.rb
mail-2.8.0.rc1 lib/mail/fields/content_id_field.rb