Class: CssCompare::CSS::Component::Value
- Defined in:
- lib/css_compare/css/component/value.rb
Overview
Represents the value of a CSS property under certain conditions declared by @media queries.
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
Checks whether two values are equal.
- #equals?(other) ⇒ Boolean
-
#important? ⇒ Bool
Tells, whether or not the value is marked as !important.
-
#initialize(val) ⇒ Value
constructor
A new instance of Value.
-
#to_s ⇒ String
The String representation of this node.
Constructor Details
#initialize(val) ⇒ Value
Returns a new instance of Value.
11 12 13 |
# File 'lib/css_compare/css/component/value.rb', line 11 def initialize(val) self.value = val end |
Instance Attribute Details
#value ⇒ CssCompare::CSS::Value::Base
8 9 10 |
# File 'lib/css_compare/css/component/value.rb', line 8 def value @value end |
Instance Method Details
#==(other) ⇒ Boolean
Checks whether two values are equal. Equal values mean, that the actual value and the importance, as well, are set equally.
21 22 23 |
# File 'lib/css_compare/css/component/value.rb', line 21 def ==(other) @value == other.value end |
#equals?(other) ⇒ Boolean
25 26 27 |
# File 'lib/css_compare/css/component/value.rb', line 25 def equals?(other) @value.equals?(other.value) end |
#important? ⇒ Bool
Tells, whether or not the value is marked as !important
43 44 45 |
# File 'lib/css_compare/css/component/value.rb', line 43 def important? @is_important end |
#to_s ⇒ String
Returns the String representation of this node.
48 49 50 |
# File 'lib/css_compare/css/component/value.rb', line 48 def to_s @value.to_s end |