Class: Rubai::MimeType

Inherits:
Object
  • Object
show all
Defined in:
lib/rubai/mime_type.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type) ⇒ MimeType

Returns a new instance of MimeType.



3
4
5
6
# File 'lib/rubai/mime_type.rb', line 3

def initialize(type)
  @mime_name = type;
  @content_type = Rubai.mimes.fetch(type.to_sym) { Rubai.mimes[:html] }
end

Class Method Details

.new_with_extension(extension) ⇒ Object



8
9
10
# File 'lib/rubai/mime_type.rb', line 8

def self.new_with_extension(extension)
  new(extension.to_sym)
end

Instance Method Details

#content_typeObject



12
13
14
# File 'lib/rubai/mime_type.rb', line 12

def content_type
  @content_type
end

#to_sObject



16
17
18
# File 'lib/rubai/mime_type.rb', line 16

def to_s
  content_type
end