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.
42 43 44 45 |
# File 'lib/css_parser/rule_set.rb', line 42 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.
40 41 42 |
# File 'lib/css_parser/rule_set.rb', line 40 def important @important end |
#value ⇒ Object
Returns the value of attribute value.
39 40 41 |
# File 'lib/css_parser/rule_set.rb', line 39 def value @value end |
Instance Method Details
#==(other) ⇒ Object
60 61 62 63 64 |
# File 'lib/css_parser/rule_set.rb', line 60 def ==(other) return false unless other.is_a?(self.class) value == other.value && important == other.important end |
#to_s ⇒ Object
56 57 58 |
# File 'lib/css_parser/rule_set.rb', line 56 def to_s important ? "#{value} !important" : value end |