Class: AssetSync::Config::FileExtToMimeTypeOverrides Private
- Inherits:
-
Object
- Object
- AssetSync::Config::FileExtToMimeTypeOverrides
- Defined in:
- lib/asset_sync/config.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
- #add(ext, mime_type) ⇒ Object
- #clear ⇒ Object
- #fetch(key) ⇒ Object private
-
#initialize ⇒ FileExtToMimeTypeOverrides
constructor
private
A new instance of FileExtToMimeTypeOverrides.
- #key?(key) ⇒ Boolean private
Constructor Details
#initialize ⇒ FileExtToMimeTypeOverrides
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of FileExtToMimeTypeOverrides.
398 399 400 401 402 403 404 |
# File 'lib/asset_sync/config.rb', line 398 def initialize # The default is to prevent new mime type `application/ecmascript` to be returned # which disables compression on some CDNs @overrides = { "js" => "application/javascript", } end |
Instance Method Details
#add(ext, mime_type) ⇒ Object
407 408 409 410 411 412 413 |
# File 'lib/asset_sync/config.rb', line 407 def add(ext, mime_type) # Symbol / Mime type object might be passed in # But we want strings only @overrides.store( ext.to_s, mime_type.to_s, ) end |
#clear ⇒ Object
416 417 418 |
# File 'lib/asset_sync/config.rb', line 416 def clear @overrides = {} end |
#fetch(key) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
427 428 429 |
# File 'lib/asset_sync/config.rb', line 427 def fetch(key) @overrides.fetch(key) end |
#key?(key) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
422 423 424 |
# File 'lib/asset_sync/config.rb', line 422 def key?(key) @overrides.key?(key) end |