class CssCompare::CSS::Component::Value
Represents the value of a CSS
property under certain conditions declared by @media queries.
Attributes
value[RW]
@return [CssCompare::CSS::Value::Base]
Public Class Methods
new(val)
click to toggle source
@param [Sass::Tree::PropNode] val the value of the property
# File lib/css_compare/css/component/value.rb, line 11 def initialize(val) self.value = val end
Public Instance Methods
==(other)
click to toggle source
Checks whether two values are equal. Equal values mean, that the actual value and the importance, as well, are set equally.
@param [CssCompare::CSS::Value::Base] other the value to compare this with @return [Boolean]
# File lib/css_compare/css/component/value.rb, line 21 def ==(other) @value == other.value end
equals?(other)
click to toggle source
# File lib/css_compare/css/component/value.rb, line 25 def equals?(other) @value.equals?(other.value) end
important?()
click to toggle source
Tells, whether or not the value is marked as !important
@return [Bool]
# File lib/css_compare/css/component/value.rb, line 43 def important? @is_important end
to_s()
click to toggle source
@return [String] the String representation of this node
# File lib/css_compare/css/component/value.rb, line 48 def to_s @value.to_s end
value=(val)
click to toggle source
@private
# File lib/css_compare/css/component/value.rb, line 30 def value=(val) if val.is_a?(self.class) @is_important = val.important? @value = val.value else @value = ValueFactory.create(val.value) @is_important = @value.important? end end