Class: Mail::ContentDispositionField
Overview
Constant Summary
collapse
- NAME =
'Content-Disposition'
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
Returns a new instance of ContentDispositionField.
14
15
16
|
# File 'lib/mail/fields/content_disposition_field.rb', line 14
def initialize(value = nil, charset = nil)
super ensure_filename_quoted(value), charset
end
|
Class Method Details
.singular? ⇒ Boolean
10
11
12
|
# File 'lib/mail/fields/content_disposition_field.rb', line 10
def self.singular?
true
end
|
Instance Method Details
#decoded ⇒ Object
41
42
43
44
|
# File 'lib/mail/fields/content_disposition_field.rb', line 41
def decoded
p = "; #{parameters.decoded}" if parameters.length > 0
"#{disposition_type}#{p}"
end
|
#disposition_type ⇒ Object
22
23
24
|
# File 'lib/mail/fields/content_disposition_field.rb', line 22
def disposition_type
element.disposition_type
end
|
#encoded ⇒ Object
36
37
38
39
|
# File 'lib/mail/fields/content_disposition_field.rb', line 36
def encoded
p = ";\r\n\s#{parameters.encoded}" if parameters.length > 0
"#{name}: #{disposition_type}#{p}\r\n"
end
|
#filename ⇒ Object
32
33
34
|
# File 'lib/mail/fields/content_disposition_field.rb', line 32
def filename
@filename ||= parameters['filename'] || parameters['name']
end
|
#parameters ⇒ Object
26
27
28
29
30
|
# File 'lib/mail/fields/content_disposition_field.rb', line 26
def parameters
@parameters = ParameterHash.new
element.parameters.each { |p| @parameters.merge!(p) } unless element.parameters.nil?
@parameters
end
|