Class: CssParser::RuleSet::Declarations::Value
- Inherits:
-
Object
- Object
- CssParser::RuleSet::Declarations::Value
- Defined in:
- lib/css_parser/rule_set.rb
Instance Attribute Summary collapse
-
#important ⇒ Object
Returns the value of attribute important.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(value, important: nil) ⇒ Value
constructor
A new instance of Value.
- #to_s ⇒ Object
Constructor Details
#initialize(value, important: nil) ⇒ Value
Returns a new instance of Value.
40 41 42 43 |
# File 'lib/css_parser/rule_set.rb', line 40 def initialize(value, important: nil) self.value = value @important = important unless important.nil? end |
Instance Attribute Details
#important ⇒ Object
Returns the value of attribute important.
38 39 40 |
# File 'lib/css_parser/rule_set.rb', line 38 def important @important end |
#value ⇒ Object
Returns the value of attribute value.
37 38 39 |
# File 'lib/css_parser/rule_set.rb', line 37 def value @value end |
Instance Method Details
#==(other) ⇒ Object
58 59 60 61 62 |
# File 'lib/css_parser/rule_set.rb', line 58 def ==(other) return false unless other.is_a?(self.class) value == other.value && important == other.important end |
#to_s ⇒ Object
54 55 56 |
# File 'lib/css_parser/rule_set.rb', line 54 def to_s important ? "#{value} !important" : value end |