class Mail::MessageIdsElement - mail-2.5.4 Documentation

# class Mail::MessageIdsElement

### Public Class Methods

new(string) click to toggle source

    # File lib/mail/elements/message_ids_element.rb, line 6
    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.new(MessageIdsElement, string, parser.failure_reason)
      end
    end

### Public Instance Methods

clean_msg_id( val ) click to toggle source

    # File lib/mail/elements/message_ids_element.rb, line 23
    def clean_msg_id( val )
      val =~ /.*<(.*)>.*/ ; $1
    end

message_id() click to toggle source

    # File lib/mail/elements/message_ids_element.rb, line 19
    def message_id
      @message_ids.first
    end

message_ids() click to toggle source

    # File lib/mail/elements/message_ids_element.rb, line 15
    def message_ids
      @message_ids
    end