Class: Sass::Tree::WhileNode
Overview
A dynamic node representing a Sass @while
loop.
Instance Attribute Summary
Attributes inherited from Node
#children, #filename, #line, #options
Instance Method Summary collapse
-
#_perform(environment) ⇒ Array<Tree::Node>
protected
Runs the child nodes until the continue expression becomes false.
-
#initialize(expr) ⇒ WhileNode
constructor
A new instance of WhileNode.
Methods inherited from Node
#<<, #==, #_to_s, #balance, #interpolate, #invalid_child?, #invisible?, #last, #perform, #perform!, #perform_children, #render, #style, #to_s, #to_sass
Constructor Details
#initialize(expr) ⇒ WhileNode
Returns a new instance of WhileNode.
9 10 11 12 |
# File 'lib/sass/tree/while_node.rb', line 9
def initialize(expr)
@expr = expr
super()
end
|
Instance Method Details
#_perform(environment) ⇒ Array<Tree::Node> (protected)
Runs the child nodes until the continue expression becomes false.
22 23 24 25 26 27 28 29 |
# File 'lib/sass/tree/while_node.rb', line 22
def _perform(environment)
children = []
new_environment = Sass::Environment.new(environment)
while @expr.perform(environment).to_bool
children += perform_children(new_environment)
end
children
end
|