Sha256: e82075d04b82d02596468480a1bd2cf081e436ab029db4266340b772be82c593
Contents?: true
Size: 1.09 KB
Versions: 18
Compression:
Stored size: 1.09 KB
Contents
# encoding: utf-8 # # # module Mail class ContentDispositionField < StructuredField FIELD_NAME = 'content-disposition' CAPITALIZED_FIELD = 'Content-Disposition' def initialize(*args) super(CAPITALIZED_FIELD, strip_field(FIELD_NAME, args.last)) end def tree @element ||= Mail::ContentDispositionElement.new(value) @tree ||= @element.tree end def element @element ||= Mail::ContentDispositionElement.new(value) end def disposition_type element.disposition_type end def parameters @parameters = ParameterHash.new element.parameters.each { |p| @parameters.merge!(p) } @parameters end def filename case when !parameters['filename'].blank? @filename = parameters['filename'] when !parameters['name'].blank? @filename = parameters['name'] else @filename = nil end @filename end # TODO: Fix this up def encoded "#{CAPITALIZED_FIELD}: #{value}\r\n" end def decoded value end end end
Version data entries
18 entries across 18 versions & 1 rubygems