Sha256: 8d32b09e3d95e8b57a0709e1ab37d321f80d319d73e5be27512892bfa648d925

Contents?: true

Size: 345 Bytes

Versions: 3

Compression:

Stored size: 345 Bytes

Contents

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

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

    def content_type
      @content_type
    end

    def to_s
      content_type
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rubai-0.1.2 lib/rubai/mime_type.rb
rubai-0.1.1 lib/rubai/mime_type.rb
rubai-0.1.0 lib/rubai/mime_type.rb