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.
12
13
14
|
# File 'lib/mail/fields/content_disposition_field.rb', line 12
def initialize(value = nil, charset = nil)
super ensure_filename_quoted(value), charset
end
|
Class Method Details
.singular? ⇒ Boolean
8
9
10
|
# File 'lib/mail/fields/content_disposition_field.rb', line 8
def self.singular?
true
end
|
Instance Method Details
#decoded ⇒ Object
39
40
41
42
|
# File 'lib/mail/fields/content_disposition_field.rb', line 39
def decoded
p = "; #{parameters.decoded}" if parameters.length > 0
"#{disposition_type}#{p}"
end
|
#disposition_type ⇒ Object
20
21
22
|
# File 'lib/mail/fields/content_disposition_field.rb', line 20
def disposition_type
element.disposition_type
end
|
#encoded ⇒ Object
34
35
36
37
|
# File 'lib/mail/fields/content_disposition_field.rb', line 34
def encoded
p = ";\r\n\s#{parameters.encoded}" if parameters.length > 0
"#{name}: #{disposition_type}#{p}\r\n"
end
|
#filename ⇒ Object
30
31
32
|
# File 'lib/mail/fields/content_disposition_field.rb', line 30
def filename
@filename ||= parameters['filename'] || parameters['name']
end
|
#parameters ⇒ Object
24
25
26
27
28
|
# File 'lib/mail/fields/content_disposition_field.rb', line 24
def parameters
@parameters = ParameterHash.new
element.parameters.each { |p| @parameters.merge!(p) } unless element.parameters.nil?
@parameters
end
|