Class: Mail::CommonMessageIdField

Inherits:
NamedStructuredField show all
Defined in:
lib/mail/fields/common_message_id_field.rb

Overview

:nodoc:

Instance Attribute Summary

Attributes inherited from CommonField

#charset, #errors, #name, #value

Instance Method Summary collapse

Methods inherited from NamedStructuredField

#initialize

Methods inherited from CommonField

#decoded, #encoded, #initialize, parse, #parse, #responsible_for?, #singular?, singular?

Constructor Details

This class inherits a constructor from Mail::NamedStructuredField

Instance Method Details

#defaultObject



19
20
21
22
# File 'lib/mail/fields/common_message_id_field.rb', line 19

def default
  ids = message_ids
  ids.one? ? ids.first : ids
end

#elementObject



7
8
9
# File 'lib/mail/fields/common_message_id_field.rb', line 7

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

#message_idObject



11
12
13
# File 'lib/mail/fields/common_message_id_field.rb', line 11

def message_id
  element.message_id
end

#message_idsObject



15
16
17
# File 'lib/mail/fields/common_message_id_field.rb', line 15

def message_ids
  element.message_ids
end

#to_sObject



24
25
26
# File 'lib/mail/fields/common_message_id_field.rb', line 24

def to_s
  decoded.to_s
end