Class: HTTP::ContentType
- Inherits:
-
Struct
- Object
- Struct
- HTTP::ContentType
- Defined in:
- lib/http/content_type.rb
Constant Summary collapse
- MIME_TYPE_RE =
%r{^([^/]+/[^;]+)(?:$|;)}
- CHARSET_RE =
/;\s*charset=([^;]+)/i
Instance Attribute Summary collapse
-
#charset ⇒ Object
Returns the value of attribute charset.
-
#mime_type ⇒ Object
Returns the value of attribute mime_type.
Class Method Summary collapse
-
.parse(str) ⇒ Object
Parse string and return ContentType struct.
Instance Attribute Details
#charset ⇒ Object
Returns the value of attribute charset
2 3 4 |
# File 'lib/http/content_type.rb', line 2 def charset @charset end |
#mime_type ⇒ Object
Returns the value of attribute mime_type
2 3 4 |
# File 'lib/http/content_type.rb', line 2 def mime_type @mime_type end |
Class Method Details
.parse(str) ⇒ Object
Parse string and return ContentType struct
8 9 10 |
# File 'lib/http/content_type.rb', line 8 def parse(str) new mime_type(str), charset(str) end |