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
depengine-0.0.1 etc/isolate/ruby-1.8/gems/mail-2.2.5/lib/mail/elements/message_ids_element.rb
mail-2.3.3 lib/mail/elements/message_ids_element.rb
mail-2.3.2 lib/mail/elements/message_ids_element.rb
mail-2.4.0 lib/mail/elements/message_ids_element.rb
mail-trunk-2.3.0 lib/mail/elements/message_ids_element.rb
mail-2.3.0 lib/mail/elements/message_ids_element.rb
mail-2.2.19 lib/mail/elements/message_ids_element.rb
mail-2.2.18 lib/mail/elements/message_ids_element.rb
mail-2.2.17 lib/mail/elements/message_ids_element.rb
mail-2.2.16 lib/mail/elements/message_ids_element.rb
mail-2.2.15 lib/mail/elements/message_ids_element.rb
mail-2.2.14 lib/mail/elements/message_ids_element.rb
mail-2.2.13 lib/mail/elements/message_ids_element.rb
mail-2.2.12 lib/mail/elements/message_ids_element.rb
mail-2.2.11 lib/mail/elements/message_ids_element.rb
dball-mail-2.2.9.7 lib/mail/elements/message_ids_element.rb
dball-mail-2.2.9.6 lib/mail/elements/message_ids_element.rb
dball-mail-2.2.9.4 lib/mail/elements/message_ids_element.rb
dball-mail-2.2.9.3 lib/mail/elements/message_ids_element.rb
mail-2.2.10 lib/mail/elements/message_ids_element.rb