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.



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

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)


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

def self.singular?
  true
end

Instance Method Details

#content_idObject



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

def content_id
  element.message_id
end

#elementObject



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

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