Sha256: a4311be9e2f913b604a8eed83655295d884f554aff4d79645f9e02d08f3e6723
Contents?: true
Size: 780 Bytes
Versions: 12
Compression:
Stored size: 780 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 to_s(*args) end def cleaned(string) string =~ /(.+);\s*$/ ? $1 : string end end end
Version data entries
12 entries across 12 versions & 1 rubygems