Sha256: 18ad715050fd0158ad55c4473e8d31aa94afd45822a8940086e1196b08b3dd46

Contents?: true

Size: 690 Bytes

Versions: 3

Compression:

Stored size: 690 Bytes

Contents

module Scales
  module Helper
    module ContentTypes
      
      TYPES = {
        :html  => 'text/html',
        :htm   => 'text/html',
        :txt   => 'text/plain',
        :css   => 'text/css',
        :yaml  => 'text/yaml',
        :js    => 'application/javascript',
        :json  => 'application/json',
        :rss   => 'application/rss+xml',
        :xml   => 'application/xml',
        :pdf   => 'application/pdf',
        :zip   => 'application/zip',
        :jpg   => 'image/jpeg',
        :png   => 'image/png'
      }
      
      class ::Symbol
        def to_content_type
          Scales::Helper::ContentTypes::TYPES[self]
        end
      end
      
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
scales-core-0.0.4 lib/scales-core/helper/content_types.rb
scales-core-0.0.1.beta.2 lib/scales-core/helper/content_types.rb
scales-core-0.0.1.beta.1 lib/scales-core/helper/content_types.rb