Class: CssCompare::CSS::Value::Base
- Inherits:
-
Object
- Object
- CssCompare::CSS::Value::Base
- Defined in:
- lib/css_compare/css/value/base.rb
Overview
The base class for wrapping the CSS property values
Direct Known Subclasses
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
Checks, whether the CSS values are equal.
-
#color? ⇒ Boolean
Checks, whether the CSS value is a color.
- #equals?(other) ⇒ Boolean
-
#important? ⇒ Boolean
Checks, whether the CSS values are flagged as !important.
-
#initialize(value) ⇒ Base
constructor
A new instance of Base.
- #to_s ⇒ String
Constructor Details
#initialize(value) ⇒ Base
Returns a new instance of Base.
12 13 14 |
# File 'lib/css_compare/css/value/base.rb', line 12 def initialize(value) @value = value end |
Instance Attribute Details
#value ⇒ Sass::Script::Tree::Node
9 10 11 |
# File 'lib/css_compare/css/value/base.rb', line 9 def value @value end |
Instance Method Details
#==(other) ⇒ Boolean
Checks, whether the CSS values are equal
19 20 21 |
# File 'lib/css_compare/css/value/base.rb', line 19 def ==(other) self.class == other.class end |
#color? ⇒ Boolean
Checks, whether the CSS value is a color. Subclasses may override this method.
38 39 40 |
# File 'lib/css_compare/css/value/base.rb', line 38 def color? false end |
#equals?(other) ⇒ Boolean
23 24 25 |
# File 'lib/css_compare/css/value/base.rb', line 23 def equals?(other) self == other end |
#important? ⇒ Boolean
Checks, whether the CSS values are flagged as !important.
30 31 32 |
# File 'lib/css_compare/css/value/base.rb', line 30 def important? @value.to_sass.include?('!important') end |
#to_s ⇒ String
43 44 45 |
# File 'lib/css_compare/css/value/base.rb', line 43 def to_s @value.to_sass end |