Class: Middleman::Imageoptim::Options
- Inherits:
-
Object
- Object
- Middleman::Imageoptim::Options
- Defined in:
- lib/middleman-imageoptim/options.rb
Overview
An options store that handles default options will accept user defined overrides
Constant Summary collapse
- EXTENSION_OPTIONS =
Mapping of valid option names to default values
[ :image_extensions, :manifest ].freeze
- OPTIONS =
{ advpng: { level: 4 }, allow_lossy: false, gifsicle: { interlace: false }, image_extensions: %w(.png .jpg .jpeg .gif .svg), jpegoptim: { strip: ['all'], max_quality: 100 }, jpegtran: { copy_chunks: false, progressive: true, jpegrescan: true }, nice: true, manifest: true, optipng: { level: 6, interlace: false }, pack: true, pngcrush: { chunks: ['alla'], fix: false, brute: false }, pngout: { copy_chunks: false, strategy: 0 }, skip_missing_workers: true, svgo: {}, threads: true, verbose: false }.freeze
Instance Method Summary collapse
- #imageoptim_options ⇒ Object
-
#initialize(user_options = {}) ⇒ Options
constructor
A new instance of Options.
Constructor Details
#initialize(user_options = {}) ⇒ Options
Returns a new instance of Options.
32 33 34 |
# File 'lib/middleman-imageoptim/options.rb', line 32 def initialize( = {}) () end |
Instance Method Details
#imageoptim_options ⇒ Object
36 37 38 39 40 |
# File 'lib/middleman-imageoptim/options.rb', line 36 def Hash[instance_variables.map do |name| [symbolize_key(name), instance_variable_get(name)] end].reject { |key| EXTENSION_OPTIONS.include?(key) } end |