Parent

CSSPool::Selector

Attributes

parse_location[RW]
rule_set[RW]
simple_selectors[RW]

Public Class Methods

new(simple_selectors = [], parse_location = {}) click to toggle source
# File lib/csspool/selector.rb, line 7
def initialize simple_selectors = [], parse_location = {}
  @simple_selectors = simple_selectors
  @parse_location   = parse_location
  @rule_set         = nil
end

Public Instance Methods

declarations() click to toggle source
# File lib/csspool/selector.rb, line 13
def declarations
  @rule_set.declarations
end
specificity() click to toggle source
# File lib/csspool/selector.rb, line 17
def specificity
  a = b = c = 0
  simple_selectors.each do |s|
    c += 1
    s.additional_selectors.each do |additional_selector|
      if Selectors::Id === additional_selector
        a += 1
      else
        b += 1
      end
    end
  end
  [a, b, c]
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.