Sha256: 56c9e8b3618203da5e23d3a53c46efc386dbeb8f7f54c5782ff72814eb0b3f64

Contents?: true

Size: 634 Bytes

Versions: 130

Compression:

Stored size: 634 Bytes

Contents

# encoding: utf-8
module Mail
  class MessageIdsElement
    
    include Mail::Utilities
    
    def initialize(string)
      parser = Mail::MessageIdsParser.new
      if tree = parser.parse(string)
        @message_ids = tree.message_ids.map { |msg_id| clean_msg_id(msg_id.text_value) }
      else
        raise Mail::Field::ParseError, "MessageIdsElement can not parse |#{string}|\nReason was: #{parser.failure_reason}\n"
      end
    end
    
    def message_ids
      @message_ids
    end
    
    def message_id
      @message_ids.first
    end
    
    def clean_msg_id( val )
      val =~ /.*<(.*)>.*/ ; $1
    end

  end
end

Version data entries

130 entries across 100 versions & 6 rubygems

Version Path
mail-2.2.9.1 lib/mail/elements/message_ids_element.rb
dball-mail-2.2.9.2 lib/mail/elements/message_ids_element.rb
dball-mail-2.2.9.1 lib/mail/elements/message_ids_element.rb
mail-2.2.9 lib/mail/elements/message_ids_element.rb
mail-2.2.7 lib/mail/elements/message_ids_element.rb
mail-2.2.6.1 lib/mail/elements/message_ids_element.rb
mail-2.2.6 lib/mail/elements/message_ids_element.rb
mail-2.2.5.2 lib/mail/elements/message_ids_element.rb
mail-2.2.5.1 lib/mail/elements/message_ids_element.rb
mail-2.2.5 lib/mail/elements/message_ids_element.rb
mail-2.2.4 lib/mail/elements/message_ids_element.rb
mail-2.2.3 lib/mail/elements/message_ids_element.rb
mail-2.2.2 lib/mail/elements/message_ids_element.rb
rack-mail_exception-0.0.1 vendor/mail/lib/mail/elements/message_ids_element.rb
mail-2.2.1 lib/mail/elements/message_ids_element.rb
mail-2.2.0 lib/mail/elements/message_ids_element.rb
mail-2.1.5.3 lib/mail/elements/message_ids_element.rb
mail-2.1.5.2 lib/mail/elements/message_ids_element.rb
mail-2.1.5.1 lib/mail/elements/message_ids_element.rb
mail-2.1.5 lib/mail/elements/message_ids_element.rb