Module: Mail::CommonMessageId

Included in:
InReplyToField, MessageIdField, ReferencesField, ResentMessageIdField
Defined in:
lib/mail/fields/common/common_message_id.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#defaultObject



25
26
27
28
29
30
31
32
# File 'lib/mail/fields/common/common_message_id.rb', line 25

def default
  return nil unless message_ids
  if message_ids.length == 1
    message_ids[0]
  else
    message_ids
  end
end

#elementObject



5
6
7
# File 'lib/mail/fields/common/common_message_id.rb', line 5

def element
  @element ||= Mail::MessageIdsElement.new(value) unless Utilities.blank?(value)
end

#message_idObject



17
18
19
# File 'lib/mail/fields/common/common_message_id.rb', line 17

def message_id
  element.message_id if element
end

#message_idsObject



21
22
23
# File 'lib/mail/fields/common/common_message_id.rb', line 21

def message_ids
  element.message_ids if element
end

#parse(val = value) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/mail/fields/common/common_message_id.rb', line 9

def parse(val = value)
  unless Utilities.blank?(val)
    @element = Mail::MessageIdsElement.new(val)
  else
    nil
  end
end