Class: It::Plain

Inherits:
Tag
  • Object
show all
Defined in:
lib/it/plain.rb

Instance Attribute Summary

Attributes inherited from Tag

#options, #tag_name

Instance Method Summary collapse

Constructor Details

#initialize(template = "%s") ⇒ Plain

Returns a new instance of Plain.

Raises:

  • (TypeError)


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