Sha256: 2835d414dcb8e28d72774ba64679f5a164e29260e4353d80a0b77d567abaabe5

Contents?: true

Size: 539 Bytes

Versions: 16

Compression:

Stored size: 539 Bytes

Contents

# encoding: utf-8
# frozen_string_literal: true
require 'mail/parsers/content_disposition_parser'

module Mail
  class ContentDispositionElement #:nodoc:
    attr_reader :disposition_type, :parameters

    def initialize(string)
      content_disposition = Mail::Parsers::ContentDispositionParser.parse(cleaned(string))
      @disposition_type = content_disposition.disposition_type
      @parameters = content_disposition.parameters
    end

    private
    def cleaned(string)
      string =~ /(.+);\s*$/ ? $1 : string
    end
  end
end

Version data entries

16 entries across 15 versions & 6 rubygems

Version Path
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.1.0/gems/mail-2.8.1/lib/mail/elements/content_disposition_element.rb
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/mail-2.8.1/lib/mail/elements/content_disposition_element.rb
minato_ruby_api_client-0.2.2 vendor/bundle/ruby/3.2.0/gems/mail-2.8.1/lib/mail/elements/content_disposition_element.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/mail-2.8.1/lib/mail/elements/content_disposition_element.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/mail-2.8.1/lib/mail/elements/content_disposition_element.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/mail-2.8.1/lib/mail/elements/content_disposition_element.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/mail-2.8.1/lib/mail/elements/content_disposition_element.rb
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/mail-2.8.1/lib/mail/elements/content_disposition_element.rb
mail-2.8.1 lib/mail/elements/content_disposition_element.rb
mail-2.8.1.rc2 lib/mail/elements/content_disposition_element.rb
mail-2.8.0.1 lib/mail/elements/content_disposition_element.rb
mail-2.8.0.1.rc1 lib/mail/elements/content_disposition_element.rb
mail-2.8.0 lib/mail/elements/content_disposition_element.rb
mail-2.8.0.rc3 lib/mail/elements/content_disposition_element.rb
mail-2.8.0.rc2 lib/mail/elements/content_disposition_element.rb
mail-2.8.0.rc1 lib/mail/elements/content_disposition_element.rb