Class: Mail::ContentIdField

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

Overview

:nodoc:

Constant Summary collapse

NAME =
'Content-ID'

Instance Attribute Summary

Attributes inherited from CommonField

#charset, #errors, #name, #value

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from CommonField

#decoded, #default, #encoded, #parse, parse, #responsible_for?, #singular?, #to_s

Constructor Details

#initialize(value = nil, charset = nil) ⇒ ContentIdField

Returns a new instance of ContentIdField.



13
14
15
16
# File 'lib/mail/fields/content_id_field.rb', line 13

def initialize(value = nil, charset = nil)
  value = Mail::Utilities.generate_message_id if Utilities.blank?(value)
  super value, charset
end

Class Method Details

.singular?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/mail/fields/content_id_field.rb', line 9

def self.singular?
  true
end

Instance Method Details

#content_idObject



22
23
24
# File 'lib/mail/fields/content_id_field.rb', line 22

def content_id
  element.message_id
end

#elementObject



18
19
20
# File 'lib/mail/fields/content_id_field.rb', line 18

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