Class: Docx::Elements::Style::Validators::ColorValidator

Inherits:
Object
  • Object
show all
Defined in:
lib/docx/elements/style/validators.rb

Constant Summary collapse

COLOR_REGEX =
/^([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/

Class Method Summary collapse

Class Method Details

.validate(value) ⇒ Object



14
15
16
# File 'lib/docx/elements/style/validators.rb', line 14

def self.validate(value)
  value =~ COLOR_REGEX
end