Sha256: 25b54971faa0e917fce5d40f819c5b0bf70b2a0dbf1fa16ada1872e1c20ed0e8

Contents?: true

Size: 952 Bytes

Versions: 72

Compression:

Stored size: 952 Bytes

Contents

# encoding: utf-8
# frozen_string_literal: true
module Mail
  module CommonMessageId # :nodoc:
    def element
      @element ||= Mail::MessageIdsElement.new(value) unless Utilities.blank?(value)
    end

    def parse(val = value)
      unless Utilities.blank?(val)
        @element = Mail::MessageIdsElement.new(val)
      else
        nil
      end
    end
    
    def message_id
      element.message_id if element
    end
    
    def message_ids
      element.message_ids if element
    end
    
    def default
      return nil unless message_ids
      if message_ids.length == 1
        message_ids[0]
      else
        message_ids
      end
    end

    private

    def do_encode(field_name)
      %Q{#{field_name}: #{formated_message_ids("\r\n ")}\r\n}
    end

    def do_decode
      formated_message_ids(' ')
    end

    def formated_message_ids(join)
      message_ids.map{ |m| "<#{m}>" }.join(join) if message_ids
    end

  end
end

Version data entries

72 entries across 56 versions & 13 rubygems

Version Path
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/mail-2.7.1/lib/mail/fields/common/common_message_id.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/mail-2.7.1/lib/mail/fields/common/common_message_id.rb
tdiary-5.2.4 vendor/bundle/ruby/3.1.0/gems/mail-2.7.1/lib/mail/fields/common/common_message_id.rb
tdiary-5.2.3 vendor/bundle/ruby/3.1.0/gems/mail-2.7.1/lib/mail/fields/common/common_message_id.rb
tdiary-5.2.2 vendor/bundle/ruby/3.1.0/gems/mail-2.7.1/lib/mail/fields/common/common_message_id.rb
tdiary-5.2.1 vendor/bundle/ruby/3.1.0/gems/mail-2.7.1/lib/mail/fields/common/common_message_id.rb
tdiary-5.2.0 vendor/bundle/ruby/3.0.0/gems/mail-2.7.1/lib/mail/fields/common/common_message_id.rb
tdiary-5.2.0 vendor/bundle/ruby/2.7.0/gems/mail-2.7.1/lib/mail/fields/common/common_message_id.rb
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/mail-2.7.1/lib/mail/fields/common/common_message_id.rb
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/mail-2.7.1/lib/mail/fields/common/common_message_id.rb
tdiary-5.1.7 vendor/bundle/ruby/3.0.0/gems/mail-2.7.1/lib/mail/fields/common/common_message_id.rb
tdiary-5.1.7 vendor/bundle/ruby/2.7.0/gems/mail-2.7.1/lib/mail/fields/common/common_message_id.rb
rails_mini_profiler-0.2.0 vendor/bundle/ruby/3.0.0/gems/mail-2.7.1/lib/mail/fields/common/common_message_id.rb
tdiary-5.1.6 vendor/bundle/ruby/3.0.0/gems/mail-2.7.1/lib/mail/fields/common/common_message_id.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/mail-2.7.1/lib/mail/fields/common/common_message_id.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/2.7.0/gems/mail-2.7.1/lib/mail/fields/common/common_message_id.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/mail-2.7.1/lib/mail/fields/common/common_message_id.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/vendor/bundle/ruby/2.7.0/gems/mail-2.7.1/lib/mail/fields/common/common_message_id.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/vendor/bundle/ruby/2.7.0/gems/mail-2.7.1/lib/mail/fields/common/common_message_id.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/mail-2.7.1/lib/mail/fields/common/common_message_id.rb