Class: NScript::ThisNode
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.
371 372 373 |
# File 'lib/nscript/parser/nodes.rb', line 371 def initialize(property=nil) @property = property end |
Instance Method Details
#compile_node(o) ⇒ Object
375 376 377 378 |
# File 'lib/nscript/parser/nodes.rb', line 375 def compile_node(o) prop = @property ? ".#{@property}" : '' write("this#{prop}") end |