Class: Styles::Properties::MatchTextDecoration

Inherits:
Base
  • Object
show all
Defined in:
lib/styles/properties/match_text_decoration.rb

Constant Summary collapse

COLOR_PROPERTY_TYPE =
:match
VALUES =

CSS value is line-through and not strikethrough, but include strikethrough as well

[:none, :underline, :line_through, :strikethrough, :blink].freeze

Instance Attribute Summary

Attributes inherited from Base

#name, #selector, #value

Instance Method Summary collapse

Methods inherited from Base

#colors, #initialize, multiple_names?, names, other_names, sub_engine, sub_engines, to_sym

Constructor Details

This class inherits a constructor from Styles::Properties::Base

Instance Method Details

#color_to_useObject



15
16
17
18
19
20
21
# File 'lib/styles/properties/match_text_decoration.rb', line 15

def color_to_use
  if value.is_a? Array
    value.map { |decoration| normalize_value decoration }
  elsif value.is_a? Symbol
    normalize_value value
  end
end

#valid_value?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/styles/properties/match_text_decoration.rb', line 11

def valid_value?
  [value].flatten.all? { |decoration| VALUES.include?(decoration) }
end