Class: Plate::GetLocalNode
- Inherits:
-
Struct
- Object
- Struct
- Plate::GetLocalNode
- Defined in:
- lib/plate/nodes.rb,
lib/plate/compiler.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name
15 16 17 |
# File 'lib/plate/nodes.rb', line 15 def name @name end |
Instance Method Details
#compile(compiler, parent = nil) ⇒ Object
66 67 68 69 70 71 72 73 74 75 |
# File 'lib/plate/compiler.rb', line 66 def compile(compiler, parent = nil) if parent && parent.is_a?(StyleNode) compiler.[name].nil? ? name : compiler.[name] elsif parent && parent.is_a?(ScriptNode) name else r = (parent && parent.repeat?) || compiler.repeating? !r && compiler.[name].nil? ? name : "{{#{name}}}" end end |