Class: PageTemplate::TextCommand
- Defined in:
- lib/PageTemplate/commands.rb
Overview
A very simple Command which outputs a static string of text
Instance Attribute Summary
Attributes inherited from Command
Instance Method Summary collapse
-
#initialize(text) ⇒ TextCommand
constructor
Creates a TextCommand object, saving
text
for future output. -
#output(namespace = nil) ⇒ Object
Returns the string provided during this object’s creation.
- #to_s ⇒ Object
Constructor Details
#initialize(text) ⇒ TextCommand
Creates a TextCommand object, saving text
for future output.
198 199 200 |
# File 'lib/PageTemplate/commands.rb', line 198 def initialize(text) @text = text end |
Instance Method Details
#output(namespace = nil) ⇒ Object
Returns the string provided during this object’s creation.
207 208 209 |
# File 'lib/PageTemplate/commands.rb', line 207 def output(namespace = nil) @text end |
#to_s ⇒ Object
202 203 204 |
# File 'lib/PageTemplate/commands.rb', line 202 def to_s @text end |