Class: SeeLessEssEss::Extractor::Collector

Inherits:
Nokogiri::XML::SAX::Document
  • Object
show all
Defined in:
lib/see-less-ess-ess.rb

Instance Method Summary collapse

Instance Method Details

#css_classesObject



40
41
42
# File 'lib/see-less-ess-ess.rb', line 40

def css_classes
  @css_classes ||= Set.new
end

#html_tagsObject



43
44
45
# File 'lib/see-less-ess-ess.rb', line 43

def html_tags
  @html_tags ||= Set.new
end

#start_element(tag, attrs = []) ⇒ Object



46
47
48
49
50
51
52
53
# File 'lib/see-less-ess-ess.rb', line 46

def start_element(tag, attrs = [])
  html_tags << tag
  attrs.each do |name, value|
    if name == "class"
      css_classes.merge(value.split)
    end
  end
end