Sha256: 9fccc9bf95faf30d1998c0b3ff6c3fb62d6f00000d6d7a95809a70f93cd16f37
Contents?: true
Size: 746 Bytes
Versions: 89
Compression:
Stored size: 746 Bytes
Contents
# encoding: utf-8 module Mail class ContentTypeElement # :nodoc: include Mail::Utilities def initialize( string ) parser = Mail::ContentTypeParser.new if tree = parser.parse(cleaned(string)) @main_type = tree.main_type.text_value @sub_type = tree.sub_type.text_value @parameters = tree.parameters else raise Mail::Field::ParseError, "ContentTypeElement can not parse |#{string}|\nReason was: #{parser.failure_reason}\n" end end def main_type @main_type end def sub_type @sub_type end def parameters @parameters end def cleaned(string) string =~ /(.+);\s*$/ ? $1 : string end end end
Version data entries
89 entries across 59 versions & 4 rubygems