Class Index [+]

Quicksearch

Sass::Tree::WhileNode

A dynamic node representing a Sass `@while` loop.

@see Sass::Tree

Public Class Methods

new(expr) click to toggle source

@param expr [Script::Node] The parse tree for the continue expression

    # File lib/sass/tree/while_node.rb, line 9
 9:     def initialize(expr)
10:       @expr = expr
11:       super()
12:     end

Protected Instance Methods

_perform(environment) click to toggle source

Runs the child nodes until the continue expression becomes false.

@param environment [Sass::Environment] The lexical environment containing

  variable and mixin values

@return [Array] The resulting static nodes @see Sass::Tree

    # File lib/sass/tree/while_node.rb, line 27
27:     def _perform(environment)
28:       children = []
29:       new_environment = Sass::Environment.new(environment)
30:       while @expr.perform(environment).to_bool
31:         children += perform_children(new_environment)
32:       end
33:       children
34:     end
invalid_child?(child) click to toggle source

Returns an error message if the given child node is invalid, and false otherwise.

{ExtendNode}s are valid within {WhileNode}s.

@param child [Tree::Node] A potential child node. @return [Boolean, String] Whether or not the child node is valid,

  as well as the error message to display if it is invalid
    # File lib/sass/tree/while_node.rb, line 44
44:     def invalid_child?(child)
45:       super unless child.is_a?(ExtendNode)
46:     end
to_src(tabs, opts, fmt) click to toggle source

@see Node#to_src

    # File lib/sass/tree/while_node.rb, line 17
17:     def to_src(tabs, opts, fmt)
18:       "#{'  ' * tabs}@while #{@expr.to_sass(opts)}" + children_to_src(tabs, opts, fmt)
19:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.