Class: StyleScript::AccessorNode
Overview
- A dotted accessor into a part of a value, or the
-
shorthand for
an accessor into the object’s prototype.
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.
407 408 409 410 411 |
# File 'lib/style_script/nodes.rb', line 407 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.
405 406 407 |
# File 'lib/style_script/nodes.rb', line 405 def soak @soak end |
Instance Method Details
#compile_node(o) ⇒ Object
413 414 415 416 |
# File 'lib/style_script/nodes.rb', line 413 def compile_node(o) proto = @prototype ? "prototype." : '' write(".#{proto}#{@name}") end |