Class: NScript::AccessorNode
Constant Summary
Constants inherited from Node
Instance Attribute Summary collapse
-
#soak ⇒ Object
readonly
Returns the value of attribute soak.
Instance Method Summary collapse
- #compile_node(o) ⇒ Object
-
#initialize(name, tag = nil) ⇒ AccessorNode
constructor
A new instance of AccessorNode.
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(name, tag = nil) ⇒ AccessorNode
Returns a new instance of AccessorNode.
346 347 348 349 350 |
# File 'lib/nscript/parser/nodes.rb', line 346 def initialize(name, tag=nil) @name = name @prototype = tag == :prototype @soak = tag == :soak end |
Instance Attribute Details
#soak ⇒ Object (readonly)
Returns the value of attribute soak.
344 345 346 |
# File 'lib/nscript/parser/nodes.rb', line 344 def soak @soak end |
Instance Method Details
#compile_node(o) ⇒ Object
352 353 354 355 |
# File 'lib/nscript/parser/nodes.rb', line 352 def compile_node(o) proto = @prototype ? "prototype." : '' write(".#{proto}#{@name}") end |