Sha256: cd735b46d6c381b93a2827e141494e874c8d36aa699d648a48e56f8b2e8d68ac

Contents?: true

Size: 586 Bytes

Versions: 14

Compression:

Stored size: 586 Bytes

Contents

# encoding: utf-8
# frozen_string_literal: true
require 'mail/parsers/message_ids_parser'
require 'mail/utilities'

module Mail
  class MessageIdsElement #:nodoc:
    def self.parse(string)
      new(string).tap(&:message_ids)
    end

    attr_reader :message_ids

    def initialize(string)
      @message_ids = parse(string)
    end

    def message_id
      message_ids.first
    end

    private
      def parse(string)
        if Utilities.blank? string
          []
        else
          Mail::Parsers::MessageIdsParser.parse(string).message_ids
        end
      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/elements/message_ids_element.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/mail-2.8.1/lib/mail/elements/message_ids_element.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/mail-2.8.1/lib/mail/elements/message_ids_element.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/mail-2.8.1/lib/mail/elements/message_ids_element.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/mail-2.8.1/lib/mail/elements/message_ids_element.rb
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/mail-2.8.1/lib/mail/elements/message_ids_element.rb
mail-2.8.1 lib/mail/elements/message_ids_element.rb
mail-2.8.1.rc2 lib/mail/elements/message_ids_element.rb
mail-2.8.0.1 lib/mail/elements/message_ids_element.rb
mail-2.8.0.1.rc1 lib/mail/elements/message_ids_element.rb
mail-2.8.0 lib/mail/elements/message_ids_element.rb
mail-2.8.0.rc3 lib/mail/elements/message_ids_element.rb
mail-2.8.0.rc2 lib/mail/elements/message_ids_element.rb
mail-2.8.0.rc1 lib/mail/elements/message_ids_element.rb