Class: StyleScript::ThisNode
Overview
A this-reference, using ‘@’.
Constant Summary
Constants inherited from Node
Instance Method Summary collapse
- #compile_node(o) ⇒ Object
-
#initialize(property = nil) ⇒ ThisNode
constructor
A new instance of ThisNode.
Methods inherited from Node
#children, children, #compile, #compile_closure, #contains?, #idt, statement, #statement?, statement_only, #statement_only?, top_sensitive, #top_sensitive?, #unwrap, #write
Constructor Details
#initialize(property = nil) ⇒ ThisNode
Returns a new instance of ThisNode.
434 435 436 |
# File 'lib/style_script/nodes.rb', line 434 def initialize(property=nil) @property = property end |
Instance Method Details
#compile_node(o) ⇒ Object
438 439 440 441 |
# File 'lib/style_script/nodes.rb', line 438 def compile_node(o) prop = @property ? ".#{@property}" : '' write("this#{prop}") end |