Class: FeduxOrgStdlib::Colors::HtmlColor
- Inherits:
-
Object
- Object
- FeduxOrgStdlib::Colors::HtmlColor
- Defined in:
- lib/fedux_org_stdlib/colors/html_color.rb
Instance Method Summary collapse
-
#initialize(color) ⇒ HtmlColor
constructor
A new instance of HtmlColor.
-
#valid? ⇒ true, false
Color string is valid.
Constructor Details
#initialize(color) ⇒ HtmlColor
Returns a new instance of HtmlColor.
7 8 9 10 |
# File 'lib/fedux_org_stdlib/colors/html_color.rb', line 7 def initialize( color ) @color = color @validator_regex = /^#[a-f0-9]{6}$/ end |
Instance Method Details
#valid? ⇒ true, false
Returns color string is valid.
13 14 15 |
# File 'lib/fedux_org_stdlib/colors/html_color.rb', line 13 def valid? @validator_regex === @color end |