Class: It::Plain
Overview
Handles replacements in non HTML templates (e.g. mails)
Instance Attribute Summary
Attributes inherited from Tag
Instance Method Summary collapse
-
#initialize(template = '%s') ⇒ Plain
constructor
A new instance of Plain.
- #process(content = '') ⇒ Object
Constructor Details
#initialize(template = '%s') ⇒ Plain
Returns a new instance of Plain.
4 5 6 7 8 |
# File 'lib/it/plain.rb', line 4 def initialize(template = '%s') raise TypeError, "expected a String, got #{template.class}" unless template.is_a?(String) @template = template end |
Instance Method Details
#process(content = '') ⇒ Object
10 11 12 |
# File 'lib/it/plain.rb', line 10 def process(content = '') format(@template, content) end |