Class: CSSminify2Enhanced::Configuration
- Inherits:
-
Object
- Object
- CSSminify2Enhanced::Configuration
- Defined in:
- lib/cssminify2/enhanced.rb
Overview
Configuration class for enhanced features
Instance Attribute Summary collapse
-
#advanced_color_optimization ⇒ Object
Returns the value of attribute advanced_color_optimization.
-
#compress_css_variables ⇒ Object
Returns the value of attribute compress_css_variables.
-
#generate_source_map ⇒ Object
Returns the value of attribute generate_source_map.
-
#merge_duplicate_selectors ⇒ Object
Returns the value of attribute merge_duplicate_selectors.
-
#optimize_shorthand_properties ⇒ Object
Returns the value of attribute optimize_shorthand_properties.
-
#preserve_ie_hacks ⇒ Object
Returns the value of attribute preserve_ie_hacks.
-
#statistics_enabled ⇒ Object
Returns the value of attribute statistics_enabled.
-
#strict_error_handling ⇒ Object
Returns the value of attribute strict_error_handling.
Class Method Summary collapse
- .aggressive ⇒ Object
-
.conservative ⇒ Object
Preset configurations.
- .modern ⇒ Object
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/cssminify2/enhanced.rb', line 23 def initialize # All new features are opt-in by default for compatibility @merge_duplicate_selectors = false @optimize_shorthand_properties = false @advanced_color_optimization = false @preserve_ie_hacks = true @compress_css_variables = false @strict_error_handling = false @generate_source_map = false @statistics_enabled = false end |
Instance Attribute Details
#advanced_color_optimization ⇒ Object
Returns the value of attribute advanced_color_optimization.
18 19 20 |
# File 'lib/cssminify2/enhanced.rb', line 18 def advanced_color_optimization @advanced_color_optimization end |
#compress_css_variables ⇒ Object
Returns the value of attribute compress_css_variables.
18 19 20 |
# File 'lib/cssminify2/enhanced.rb', line 18 def compress_css_variables @compress_css_variables end |
#generate_source_map ⇒ Object
Returns the value of attribute generate_source_map.
18 19 20 |
# File 'lib/cssminify2/enhanced.rb', line 18 def generate_source_map @generate_source_map end |
#merge_duplicate_selectors ⇒ Object
Returns the value of attribute merge_duplicate_selectors.
18 19 20 |
# File 'lib/cssminify2/enhanced.rb', line 18 def merge_duplicate_selectors @merge_duplicate_selectors end |
#optimize_shorthand_properties ⇒ Object
Returns the value of attribute optimize_shorthand_properties.
18 19 20 |
# File 'lib/cssminify2/enhanced.rb', line 18 def optimize_shorthand_properties @optimize_shorthand_properties end |
#preserve_ie_hacks ⇒ Object
Returns the value of attribute preserve_ie_hacks.
18 19 20 |
# File 'lib/cssminify2/enhanced.rb', line 18 def preserve_ie_hacks @preserve_ie_hacks end |
#statistics_enabled ⇒ Object
Returns the value of attribute statistics_enabled.
18 19 20 |
# File 'lib/cssminify2/enhanced.rb', line 18 def statistics_enabled @statistics_enabled end |
#strict_error_handling ⇒ Object
Returns the value of attribute strict_error_handling.
18 19 20 |
# File 'lib/cssminify2/enhanced.rb', line 18 def strict_error_handling @strict_error_handling end |
Class Method Details
.aggressive ⇒ Object
40 41 42 43 44 45 46 47 |
# File 'lib/cssminify2/enhanced.rb', line 40 def self.aggressive config = new config.merge_duplicate_selectors = true config.optimize_shorthand_properties = true config.advanced_color_optimization = true config.compress_css_variables = true config end |
.conservative ⇒ Object
Preset configurations
36 37 38 |
# File 'lib/cssminify2/enhanced.rb', line 36 def self.conservative new # All features disabled end |
.modern ⇒ Object
49 50 51 52 53 54 |
# File 'lib/cssminify2/enhanced.rb', line 49 def self.modern config = aggressive config.generate_source_map = true config.statistics_enabled = true config end |