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



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

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

#elementObject



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

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

#message_idObject



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

def message_id
  element.message_id if element
end

#message_idsObject



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

def message_ids
  element.message_ids if element
end

#parse(val = value) ⇒ Object



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

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