Class: Macros4Cuke::Templating::StaticText
- Inherits:
-
Object
- Object
- Macros4Cuke::Templating::StaticText
- Defined in:
- lib/macros4cuke/templating/engine.rb,
lib/macros4cuke/templating/template-element.rb
Overview
Class used internally by the template engine.
Represents a static piece of text from a template.
A static text is a text that is reproduced verbatim
when rendering a template.
Instance Attribute Summary collapse
-
#source ⇒ Object
readonly
The static text extracted from the original template.
Instance Method Summary collapse
-
#initialize(aSourceText) ⇒ StaticText
constructor
A new instance of StaticText.
-
#render(aContextObject, theLocals) ⇒ String
Render the static text.
Constructor Details
#initialize(aSourceText) ⇒ StaticText
Returns a new instance of StaticText.
30 31 32 |
# File 'lib/macros4cuke/templating/engine.rb', line 30 def initialize(aSourceText) @source = aSourceText end |
Instance Attribute Details
#source ⇒ Object (readonly)
The static text extracted from the original template.
25 26 27 |
# File 'lib/macros4cuke/templating/engine.rb', line 25 def source @source end |
Instance Method Details
#render(aContextObject, theLocals) ⇒ String
Render the static text. This method has the same signature as the Engine#render method.
39 40 41 |
# File 'lib/macros4cuke/templating/engine.rb', line 39 def render(aContextObject, theLocals) return source end |