Class: Squib::Args::DropShadow

Inherits:
Object
  • Object
show all
Includes:
ArgLoader, ColorValidator
Defined in:
lib/squib/args/drop_shadow.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ColorValidator

#colorify

Methods included from ArgLoader

#[], #convert_units, #deck_conf, #defaultify, #expand_and_set_and_defaultify, #expandable_singleton?, #extract!, #load!, #prep_layout_args, #validate

Constructor Details

#initialize(custom_colors) ⇒ DropShadow

Returns a new instance of DropShadow.



12
13
14
# File 'lib/squib/args/drop_shadow.rb', line 12

def initialize(custom_colors)
  @custom_colors = custom_colors
end

Class Method Details

.expanding_parametersObject



26
27
28
# File 'lib/squib/args/drop_shadow.rb', line 26

def self.expanding_parameters
  self.parameters.keys # all of them
end

.parametersObject



16
17
18
19
20
21
22
23
24
# File 'lib/squib/args/drop_shadow.rb', line 16

def self.parameters
  {
    shadow_color: :black,
    shadow_offset_x: 3,
    shadow_offset_y: 3,
    shadow_radius: nil,
    shadow_trim: 0,
  }
end

.params_with_unitsObject



30
31
32
# File 'lib/squib/args/drop_shadow.rb', line 30

def self.params_with_units
  [:shadow_offset_x, :shadow_offset_y, :shadow_radius, :shadow_trim]
end

Instance Method Details

#validate_shadow_color(arg, _i) ⇒ Object



34
35
36
# File 'lib/squib/args/drop_shadow.rb', line 34

def validate_shadow_color(arg, _i)
  colorify(arg, @custom_colors)
end