Class: It::Plain
Instance Attribute Summary
Attributes inherited from Tag
Instance Method Summary (collapse)
-
- (Plain) initialize(template = "%s")
constructor
A new instance of Plain.
- - (Object) process(content)
Constructor Details
- (Plain) initialize(template = "%s")
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
- (Object) process(content)
8 9 10 |
# File 'lib/it/plain.rb', line 8 def process(content) sprintf(@template, content) end |