Sha256: 6d628682da1592aa4d31794909671026cef446db1ed63b5a197b9ba59c4a62ab

Contents?: true

Size: 704 Bytes

Versions: 94

Compression:

Stored size: 704 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 cleaned(string)
      string =~ /(.+);\s*$/ ? $1 : string
    end
    
  end
end

Version data entries

94 entries across 64 versions & 4 rubygems

Version Path
depengine-0.0.31 etc/isolate/jruby-1.8/gems/mail-2.2.5/lib/mail/elements/content_disposition_element.rb
depengine-0.0.31 etc/isolate/ruby-1.8/gems/mail-2.2.5/lib/mail/elements/content_disposition_element.rb
depengine-0.0.30 etc/isolate/jruby-1.8/gems/mail-2.2.5/lib/mail/elements/content_disposition_element.rb
depengine-0.0.30 etc/isolate/ruby-1.8/gems/mail-2.2.5/lib/mail/elements/content_disposition_element.rb
depengine-0.0.29 etc/isolate/jruby-1.8/gems/mail-2.2.5/lib/mail/elements/content_disposition_element.rb
depengine-0.0.29 etc/isolate/ruby-1.8/gems/mail-2.2.5/lib/mail/elements/content_disposition_element.rb
depengine-0.0.28 etc/isolate/jruby-1.8/gems/mail-2.2.5/lib/mail/elements/content_disposition_element.rb
depengine-0.0.28 etc/isolate/ruby-1.8/gems/mail-2.2.5/lib/mail/elements/content_disposition_element.rb
depengine-0.0.27 etc/isolate/ruby-1.8/gems/mail-2.2.5/lib/mail/elements/content_disposition_element.rb
depengine-0.0.27 etc/isolate/jruby-1.8/gems/mail-2.2.5/lib/mail/elements/content_disposition_element.rb
depengine-0.0.26 etc/isolate/ruby-1.8/gems/mail-2.2.5/lib/mail/elements/content_disposition_element.rb
depengine-0.0.26 etc/isolate/jruby-1.8/gems/mail-2.2.5/lib/mail/elements/content_disposition_element.rb
depengine-0.0.25 etc/isolate/jruby-1.8/gems/mail-2.2.5/lib/mail/elements/content_disposition_element.rb
depengine-0.0.25 etc/isolate/ruby-1.8/gems/mail-2.2.5/lib/mail/elements/content_disposition_element.rb
depengine-0.0.24 etc/isolate/jruby-1.8/gems/mail-2.2.5/lib/mail/elements/content_disposition_element.rb
depengine-0.0.24 etc/isolate/ruby-1.8/gems/mail-2.2.5/lib/mail/elements/content_disposition_element.rb
depengine-0.0.23 etc/isolate/jruby-1.8/gems/mail-2.2.5/lib/mail/elements/content_disposition_element.rb
depengine-0.0.23 etc/isolate/ruby-1.8/gems/mail-2.2.5/lib/mail/elements/content_disposition_element.rb
depengine-0.0.22 etc/isolate/ruby-1.8/gems/mail-2.2.5/lib/mail/elements/content_disposition_element.rb
depengine-0.0.22 etc/isolate/jruby-1.8/gems/mail-2.2.5/lib/mail/elements/content_disposition_element.rb