Class: Pancake::MimeTypes::Type
Overview
A basic type for mime types Each type can have an extension and many type strings that correspond to the mime type that would be specified in a request When a Pancake::MimeTypes::Type is created, it is added to the Pancake::MimeTypes.types collection
Instance Attribute Summary collapse
- #extension ⇒ Object readonly
- #type_strings ⇒ Object readonly
Instance Method Summary collapse
-
#initialize(extension, *type_strings) ⇒ Type
constructor
A new instance of Type.
Constructor Details
#initialize(extension, *type_strings) ⇒ Type
Returns a new instance of Type.
267 268 269 270 271 272 273 274 |
# File 'lib/pancake/mime_types.rb', line 267 def initialize(extension, *type_strings) @extension = extension @type_strings = [] type_strings.flatten.each do |ts| @type_strings << ts end MimeTypes.types << self end |