Class: SimpleFeed::Key::TextTemplate
- Inherits:
-
Struct
- Object
- Struct
- SimpleFeed::Key::TextTemplate
- Defined in:
- lib/simplefeed/key/template.rb
Instance Attribute Summary collapse
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
Instance Attribute Details
#text ⇒ Object
Returns the value of attribute text
8 9 10 |
# File 'lib/simplefeed/key/template.rb', line 8 def text @text end |
Instance Method Details
#render(params = {}) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/simplefeed/key/template.rb', line 9 def render(params = {}) output = text.dup params.each_pair do |key, value| output.gsub!(/{{\s*#{key}\s*}}/, value.to_s) end output end |