Class: Cat::Style::Fill
- Inherits:
-
Object
- Object
- Cat::Style::Fill
- Defined in:
- lib/cat/style/fill.rb
Instance Method Summary collapse
-
#initialize(color) ⇒ Fill
constructor
A new instance of Fill.
- #to_s ⇒ Object
Constructor Details
#initialize(color) ⇒ Fill
Returns a new instance of Fill.
4 5 6 7 |
# File 'lib/cat/style/fill.rb', line 4 def initialize(color) @color = color @color = "black" unless (color =~ /^\$|#|rgb/) >= 0 end |
Instance Method Details
#to_s ⇒ Object
9 10 11 |
# File 'lib/cat/style/fill.rb', line 9 def to_s "background: #{@color};" end |