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



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

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

#elementObject



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

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

#message_idObject



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

def message_id
  element.message_id
end

#message_idsObject



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

def message_ids
  element.message_ids
end

#to_sObject



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

def to_s
  decoded.to_s
end