Class: UtilityPalettes::Configuration
- Inherits:
-
Object
- Object
- UtilityPalettes::Configuration
- Defined in:
- lib/utility_palettes/configuration.rb
Instance Attribute Summary collapse
-
#absolutes ⇒ Object
Returns the value of attribute absolutes.
-
#enable_environments ⇒ Object
Returns the value of attribute enable_environments.
-
#method ⇒ Object
Returns the value of attribute method.
-
#output_dated ⇒ Object
Returns the value of attribute output_dated.
-
#output_filename ⇒ Object
Returns the value of attribute output_filename.
-
#output_files ⇒ Object
Returns the value of attribute output_files.
-
#output_format ⇒ Object
Returns the value of attribute output_format.
-
#output_prefix ⇒ Object
Returns the value of attribute output_prefix.
-
#output_suffix ⇒ Object
Returns the value of attribute output_suffix.
-
#relatives ⇒ Object
Returns the value of attribute relatives.
-
#singles ⇒ Object
Returns the value of attribute singles.
-
#steps_b ⇒ Object
Returns the value of attribute steps_b.
-
#steps_g ⇒ Object
Returns the value of attribute steps_g.
-
#steps_h ⇒ Object
Returns the value of attribute steps_h.
-
#steps_l ⇒ Object
Returns the value of attribute steps_l.
-
#steps_r ⇒ Object
Returns the value of attribute steps_r.
-
#steps_s ⇒ Object
Returns the value of attribute steps_s.
-
#use_default_absolutes ⇒ Object
Returns the value of attribute use_default_absolutes.
-
#use_default_relatives ⇒ Object
Returns the value of attribute use_default_relatives.
-
#use_default_singles ⇒ Object
Returns the value of attribute use_default_singles.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #reset! ⇒ Object
- #validate_settings ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/utility_palettes/configuration.rb', line 11 def initialize # Enabled Environments @enable_environments = [:development] # Defaults @use_default_absolutes = true @use_default_relatives = true @use_default_singles = true # Output @output_filename = 'utility_palettes' @output_dated = false @output_files = ['scss'] @output_format = 'hex' @output_prefix = '' @output_suffix = '' # Method @method = 'hsl' # Steps @steps_h = 0 @steps_s = 3 @steps_l = 8 @steps_r = 9 @steps_g = 9 @steps_b = 9 # Colors - Absolutes @absolutes = {} # Colors - Relatives @relatives = {} # Colors - Singles @singles = {} end |
Instance Attribute Details
#absolutes ⇒ Object
Returns the value of attribute absolutes.
5 6 7 |
# File 'lib/utility_palettes/configuration.rb', line 5 def absolutes @absolutes end |
#enable_environments ⇒ Object
Returns the value of attribute enable_environments.
5 6 7 |
# File 'lib/utility_palettes/configuration.rb', line 5 def enable_environments @enable_environments end |
#method ⇒ Object
Returns the value of attribute method.
5 6 7 |
# File 'lib/utility_palettes/configuration.rb', line 5 def method @method end |
#output_dated ⇒ Object
Returns the value of attribute output_dated.
5 6 7 |
# File 'lib/utility_palettes/configuration.rb', line 5 def output_dated @output_dated end |
#output_filename ⇒ Object
Returns the value of attribute output_filename.
5 6 7 |
# File 'lib/utility_palettes/configuration.rb', line 5 def output_filename @output_filename end |
#output_files ⇒ Object
Returns the value of attribute output_files.
5 6 7 |
# File 'lib/utility_palettes/configuration.rb', line 5 def output_files @output_files end |
#output_format ⇒ Object
Returns the value of attribute output_format.
5 6 7 |
# File 'lib/utility_palettes/configuration.rb', line 5 def output_format @output_format end |
#output_prefix ⇒ Object
Returns the value of attribute output_prefix.
5 6 7 |
# File 'lib/utility_palettes/configuration.rb', line 5 def output_prefix @output_prefix end |
#output_suffix ⇒ Object
Returns the value of attribute output_suffix.
5 6 7 |
# File 'lib/utility_palettes/configuration.rb', line 5 def output_suffix @output_suffix end |
#relatives ⇒ Object
Returns the value of attribute relatives.
5 6 7 |
# File 'lib/utility_palettes/configuration.rb', line 5 def relatives @relatives end |
#singles ⇒ Object
Returns the value of attribute singles.
5 6 7 |
# File 'lib/utility_palettes/configuration.rb', line 5 def singles @singles end |
#steps_b ⇒ Object
Returns the value of attribute steps_b.
5 6 7 |
# File 'lib/utility_palettes/configuration.rb', line 5 def steps_b @steps_b end |
#steps_g ⇒ Object
Returns the value of attribute steps_g.
5 6 7 |
# File 'lib/utility_palettes/configuration.rb', line 5 def steps_g @steps_g end |
#steps_h ⇒ Object
Returns the value of attribute steps_h.
5 6 7 |
# File 'lib/utility_palettes/configuration.rb', line 5 def steps_h @steps_h end |
#steps_l ⇒ Object
Returns the value of attribute steps_l.
5 6 7 |
# File 'lib/utility_palettes/configuration.rb', line 5 def steps_l @steps_l end |
#steps_r ⇒ Object
Returns the value of attribute steps_r.
5 6 7 |
# File 'lib/utility_palettes/configuration.rb', line 5 def steps_r @steps_r end |
#steps_s ⇒ Object
Returns the value of attribute steps_s.
5 6 7 |
# File 'lib/utility_palettes/configuration.rb', line 5 def steps_s @steps_s end |
#use_default_absolutes ⇒ Object
Returns the value of attribute use_default_absolutes.
5 6 7 |
# File 'lib/utility_palettes/configuration.rb', line 5 def use_default_absolutes @use_default_absolutes end |
#use_default_relatives ⇒ Object
Returns the value of attribute use_default_relatives.
5 6 7 |
# File 'lib/utility_palettes/configuration.rb', line 5 def use_default_relatives @use_default_relatives end |
#use_default_singles ⇒ Object
Returns the value of attribute use_default_singles.
5 6 7 |
# File 'lib/utility_palettes/configuration.rb', line 5 def use_default_singles @use_default_singles end |
Instance Method Details
#reset! ⇒ Object
49 50 51 |
# File 'lib/utility_palettes/configuration.rb', line 49 def reset! self.initialize end |
#validate_settings ⇒ Object
53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/utility_palettes/configuration.rb', line 53 def validate_settings warn "ERROR: The colour sequence method you have submitted to Utility Palettes < #{@method} > is not available" unless @method.to_s.in?(['hsl']) # warn "ERROR: The colour sequence steps you have submitted to Utility Palettes < #{@steps} > have not been formatted as a hash" unless @steps.is_a?(Hash) warn "ERROR: The output files you have submitted to Utility Palettes < #{@output_files} > have not been formatted as an array" unless @absolutes.is_a?(Array) warn "ERROR: The absolute swatches you have submitted to Utility Palettes < #{@absolutes} > have not been formatted as a hash" unless @absolutes.is_a?(Hash) warn "ERROR: The relative swatches you have submitted to Utility Palettes < #{@relatives} > have not been formatted as a hash" unless @relatives.is_a?(Hash) warn "ERROR: The single swatches you have submitted to Utility Palettes < #{@singles} > have not been formatted as a hash" unless @singles.is_a?(Hash) [@method.to_s.in?(['hsl']), @absolutes.is_a?(Hash), @relatives.is_a?(Hash), @singles.is_a?(Hash)].all? end |