Class: It::Plain
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.
3 4 5 6 |
# File 'lib/it/plain.rb', line 3 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
8 9 10 |
# File 'lib/it/plain.rb', line 8 def process(content) sprintf(@template, content) end |