Class: Mail::MessageIdsElement

Inherits:
Object
  • Object
show all
Includes:
Utilities
Defined in:
lib/mail/elements/message_ids_element.rb

Constant Summary

Constant Summary

Constants included from Constants

Constants::ASTERISK, Constants::ATOM_UNSAFE, Constants::B_VALUES, Constants::CAPITAL_M, Constants::COLON, Constants::CONTROL_CHAR, Constants::CR, Constants::CRLF, Constants::CR_ENCODED, Constants::EMPTY, Constants::ENCODED_VALUE, Constants::EQUAL_LF, Constants::FIELD_BODY, Constants::FIELD_LINE, Constants::FIELD_NAME, Constants::FIELD_PREFIX, Constants::FIELD_SPLIT, Constants::FWS, Constants::HEADER_LINE, Constants::HEADER_SPLIT, Constants::HYPHEN, Constants::LF, Constants::LF_ENCODED, Constants::NULL_SENDER, Constants::PHRASE_UNSAFE, Constants::QP_SAFE, Constants::QP_UNSAFE, Constants::Q_VALUES, Constants::SPACE, Constants::TEXT, Constants::TOKEN_UNSAFE, Constants::UNDERSCORE, Constants::WSP

Instance Method Summary collapse

Methods included from Utilities

#atom_safe?, #bracket, #capitalize_field, #constantize, #dasherize, #dquote, #escape_paren, #map_lines, #map_with_index, #match_to_s, #paren, #quote_atom, #quote_phrase, #quote_token, #token_safe?, #unbracket, #underscoreize, #unparen, #unquote, #uri_escape, #uri_parser, #uri_unescape

Constructor Details

#initialize(string) ⇒ MessageIdsElement

Returns a new instance of MessageIdsElement



7
8
9
# File 'lib/mail/elements/message_ids_element.rb', line 7

def initialize(string)
  @message_ids = Mail::Parsers::MessageIdsParser.new.parse(string).message_ids.map { |msg_id| clean_msg_id(msg_id) }
end

Instance Method Details

#clean_msg_id(val) ⇒ Object



19
20
21
# File 'lib/mail/elements/message_ids_element.rb', line 19

def clean_msg_id( val )
  val =~ /.*<(.*)>.*/ ; $1
end

#message_idObject



15
16
17
# File 'lib/mail/elements/message_ids_element.rb', line 15

def message_id
  @message_ids.first
end

#message_idsObject



11
12
13
# File 'lib/mail/elements/message_ids_element.rb', line 11

def message_ids
  @message_ids
end