Module: EdgeCast::Client::Media::Cache::Settings::Compression
- Included in:
- EdgeCast::Client
- Defined in:
- lib/edge_cast/client/media/cache/settings/compression.rb
Instance Method Summary collapse
- #compression(media_type = nil) ⇒ Object
- #disable_compression(media_type, content_types) ⇒ Object
- #enable_compression(media_type, content_types) ⇒ Object
Instance Method Details
#compression(media_type = nil) ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/edge_cast/client/media/cache/settings/compression.rb', line 10 def compression(media_type = nil) response = get("compression#{settings_query_string(media_type)}") (response.is_a?(Array) ? response : [response]).inject({}) do |hash, r| return hash unless Media.valid_type?(r['MediaTypeId']) Media.from_code(r['MediaTypeId'])[:keys].each { |key| hash[key] = r.to_result! } hash end end |
#disable_compression(media_type, content_types) ⇒ Object
25 26 27 |
# File 'lib/edge_cast/client/media/cache/settings/compression.rb', line 25 def disable_compression(media_type, content_types) update_compression(media_type, content_types, 0) end |
#enable_compression(media_type, content_types) ⇒ Object
21 22 23 |
# File 'lib/edge_cast/client/media/cache/settings/compression.rb', line 21 def enable_compression(media_type, content_types) update_compression(media_type, content_types, 1) end |