Class: Mail::MimeVersionField
Overview
Constant Summary
collapse
- NAME =
'Mime-Version'
Instance Attribute Summary
Attributes inherited from CommonField
#charset, #errors, #name, #value
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from CommonField
#default, #parse, parse, #responsible_for?, #singular?, #to_s
Constructor Details
#initialize(value = nil, charset = nil) ⇒ MimeVersionField
Returns a new instance of MimeVersionField.
14
15
16
17
|
# File 'lib/mail/fields/mime_version_field.rb', line 14
def initialize(value = nil, charset = nil)
value = '1.0' if Utilities.blank?(value)
super value, charset
end
|
Class Method Details
.singular? ⇒ Boolean
10
11
12
|
# File 'lib/mail/fields/mime_version_field.rb', line 10
def self.singular?
true
end
|
Instance Method Details
#decoded ⇒ Object
39
40
41
|
# File 'lib/mail/fields/mime_version_field.rb', line 39
def decoded
version
end
|
#element ⇒ Object
19
20
21
|
# File 'lib/mail/fields/mime_version_field.rb', line 19
def element
@element ||= Mail::MimeVersionElement.new(value)
end
|
#encoded ⇒ Object
35
36
37
|
# File 'lib/mail/fields/mime_version_field.rb', line 35
def encoded
"#{name}: #{version}\r\n"
end
|
#major ⇒ Object
27
28
29
|
# File 'lib/mail/fields/mime_version_field.rb', line 27
def major
element.major.to_i
end
|
#minor ⇒ Object
31
32
33
|
# File 'lib/mail/fields/mime_version_field.rb', line 31
def minor
element.minor.to_i
end
|
#version ⇒ Object
23
24
25
|
# File 'lib/mail/fields/mime_version_field.rb', line 23
def version
"#{element.major}.#{element.minor}"
end
|