Class: StyleScript::ClosureNode
- Inherits:
-
Object
- Object
- StyleScript::ClosureNode
- Defined in:
- lib/style_script/nodes.rb
Overview
A faux-node used to wrap an expressions body in a closure.
Class Method Summary collapse
Class Method Details
.wrap(expressions, statement = false) ⇒ Object
777 778 779 780 781 |
# File 'lib/style_script/nodes.rb', line 777 def self.wrap(expressions, statement=false) func = ParentheticalNode.new(CodeNode.new([], Expressions.wrap(expressions))) call = CallNode.new(ValueNode.new(func, AccessorNode.new(Value.new('call'))), [Value.new('this')]) statement ? Expressions.wrap(call) : call end |