Class: PageTemplate::TextCommand

Inherits:
Command
  • Object
show all
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

#called_as

Instance Method Summary collapse

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_sObject



202
203
204
# File 'lib/PageTemplate/commands.rb', line 202

def to_s
  @text
end