Class: Sass::Tree::Visitors::Base Abstract

Inherits:
Object
  • Object
show all
Defined in:
.ruby-sass/lib/sass/tree/visitors/base.rb

Overview

This class is abstract.

The abstract base class for Sass visitors. Visitors should extend this class, then implement `visit_*` methods for each node they care about (e.g. `visit_rule` for RuleNode or `visit_for` for ForNode). These methods take the node in question as argument. They may `yield` to visit the child nodes of the current node.

Note: due to the unusual nature of IfNode, special care must be taken to ensure that it is properly handled. In particular, there is no built-in scaffolding for dealing with the return value of `@else` nodes.

Direct Known Subclasses

CheckNesting, Convert, Cssize, DeepCopy, Extend, Perform, SetOptions, ToCss

Direct Known Subclasses

CheckNesting, Convert, Cssize, DeepCopy, Extend, Perform, SetOptions, ToCss

Class Method Summary (collapse)

Class Method Details

.visit(root) ⇒ Object

Runs the visitor on a tree.

Parameters:

  • root (Tree::Node)

    The root node of the Sass tree.

Returns:

  • (Object)

    The return value of #visit for the root node.



23
24
25
# File '.ruby-sass/lib/sass/tree/visitors/base.rb', line 23

def self.visit(root)
  new.send(:visit, root)
end