Class: StyleScript::IndexNode
Overview
An indexed accessor into a part of an array or object.
Constant Summary
Constants inherited from Node
Instance Method Summary collapse
- #compile_node(o) ⇒ Object
-
#initialize(index) ⇒ IndexNode
constructor
A new instance of IndexNode.
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(index) ⇒ IndexNode
Returns a new instance of IndexNode.
423 424 425 |
# File 'lib/style_script/nodes.rb', line 423 def initialize(index) @index = index end |
Instance Method Details
#compile_node(o) ⇒ Object
427 428 429 |
# File 'lib/style_script/nodes.rb', line 427 def compile_node(o) write("[#{@index.compile(o)}]") end |