Sha256: b2cccca7d22ab6ae58592f43a75d111a1e4d7b15b2ea4e6d4a33ce87e4aec246

Contents?: true

Size: 738 Bytes

Versions: 12

Compression:

Stored size: 738 Bytes

Contents

# encoding: utf-8
module Mail
  class ContentDispositionElement # :nodoc:
    
    include Mail::Utilities
    
    def initialize( string )
      parser = Mail::ContentDispositionParser.new
      if tree = parser.parse(cleaned(string))
        @disposition_type = tree.disposition_type.text_value
        @parameters = tree.parameters
      else
        raise Mail::Field::ParseError, "ContentDispositionElement can not parse |#{string}|\nReason was: #{parser.failure_reason}\n"
      end
    end
    
    def disposition_type
      @disposition_type
    end
    
    def parameters
      @parameters
    end
    
    def to_s(*args)

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

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
mail-1.3.4 lib/mail/elements/content_disposition_element.rb
mail-1.3.3 lib/mail/elements/content_disposition_element.rb
mail-1.3.2 lib/mail/elements/content_disposition_element.rb
mail-1.3.1 lib/mail/elements/content_disposition_element.rb
mail-1.3.0 lib/mail/elements/content_disposition_element.rb
mail-1.2.9 lib/mail/elements/content_disposition_element.rb
mail-1.2.8 lib/mail/elements/content_disposition_element.rb
mail-1.2.6 lib/mail/elements/content_disposition_element.rb
mail-1.2.5 ./lib/mail/elements/content_disposition_element.rb
mail-1.2.1 ./lib/mail/elements/content_disposition_element.rb
mail-1.1.0 ./lib/mail/elements/content_disposition_element.rb
mail-1.0.0 ./lib/mail/elements/content_disposition_element.rb