Class: Amrita2::Core::StaticNode

Inherits:
BaseNode show all
Defined in:
lib/amrita2/template.rb

Overview

:nodoc: all

Direct Known Subclasses

GetTextBridge::TextNodeForGetText

Instance Attribute Summary

Attributes inherited from BaseNode

#parent

Instance Method Summary collapse

Methods inherited from BaseNode

#dynamic?, #has_ruby?, #module_src, #parent_de, #root

Constructor Details

#initialize(parent, node) ⇒ StaticNode

Returns a new instance of StaticNode.



650
651
652
653
# File 'lib/amrita2/template.rb', line 650

def initialize(parent, node)
  super(parent)
  @node = node
end

Instance Method Details

#render_me(cg) ⇒ Object



655
656
657
658
659
660
661
662
# File 'lib/amrita2/template.rb', line 655

def render_me(cg)
  #cg.put_string_expression(cg.define_constant(@node.to_s.inspect))

  # to keep  
  s = ""
  @node.output(s, :preserve=>true)
  cg.put_string_expression(cg.define_constant(s.inspect))
end