Class: SassExtractor::Extractor

Inherits:
Object
  • Object
show all
Defined in:
lib/sass-extractor.rb

Instance Method Summary collapse

Constructor Details

#initialize(tree) ⇒ Extractor

Returns a new instance of Extractor.



21
22
23
24
# File 'lib/sass-extractor.rb', line 21

def initialize(tree)
  @tree = tree
  compile
end

Instance Method Details

#check_nestingObject



38
39
40
# File 'lib/sass-extractor.rb', line 38

def check_nesting
  Sass::Tree::Visitors::CheckNesting.visit(@tree)
end

#compileObject



30
31
32
33
34
35
36
# File 'lib/sass-extractor.rb', line 30

def compile
  check_nesting
  @tree = Sass::Tree::Visitors::Perform.visit(@tree)
  check_nesting
  @tree, extends = Sass::Tree::Visitors::Cssize.visit(@tree)
  @tree = @tree.do_extend(extends) unless extends.empty?
end

#get_rules(prefixes) ⇒ Object



26
27
28
# File 'lib/sass-extractor.rb', line 26

def get_rules(prefixes)
  Visitor.visit(@tree, prefixes)
end