class StyleStats::Css::AggregateDeclaration
Attributes
declarations[RW]
Public Class Methods
new()
click to toggle source
# File lib/style_stats/css/aggregate_declaration.rb, line 5 def initialize() self.declarations = {} end
Public Instance Methods
[](property)
click to toggle source
# File lib/style_stats/css/aggregate_declaration.rb, line 19 def [](property) self.declarations[property] || {} end
add(property, value)
click to toggle source
# File lib/style_stats/css/aggregate_declaration.rb, line 9 def add(property, value) if self.declarations.has_key?(property) self.declarations[property][:values] << value self.declarations[property][:values].uniq! self.declarations[property][:count] += 1 else self.declarations[property] = {values: [value], count: 1} end end