Class: StyleStats::Css::Declaration
- Inherits:
-
Object
- Object
- StyleStats::Css::Declaration
- Defined in:
- lib/style_stats/css/declaration.rb
Instance Attribute Summary collapse
-
#important ⇒ Object
Returns the value of attribute important.
-
#property ⇒ Object
Returns the value of attribute property.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(property, value) ⇒ Declaration
constructor
A new instance of Declaration.
Constructor Details
#initialize(property, value) ⇒ Declaration
Returns a new instance of Declaration.
5 6 7 8 9 |
# File 'lib/style_stats/css/declaration.rb', line 5 def initialize(property, value) self.important = !!value.match(/!important/) self.property = property self.value = value.gsub("!important", '').strip.force_encoding("utf-8") end |
Instance Attribute Details
#important ⇒ Object
Returns the value of attribute important.
3 4 5 |
# File 'lib/style_stats/css/declaration.rb', line 3 def important @important end |
#property ⇒ Object
Returns the value of attribute property.
3 4 5 |
# File 'lib/style_stats/css/declaration.rb', line 3 def property @property end |
#value ⇒ Object
Returns the value of attribute value.
3 4 5 |
# File 'lib/style_stats/css/declaration.rb', line 3 def value @value end |