Class: DbMailerRails::Replacer
- Inherits:
-
Object
- Object
- DbMailerRails::Replacer
- Defined in:
- lib/db_mailer_rails/replacer.rb
Instance Attribute Summary collapse
-
#replace_hash ⇒ Object
Returns the value of attribute replace_hash.
Instance Method Summary collapse
-
#initialize(replace_hash) ⇒ Replacer
constructor
A new instance of Replacer.
- #replace(text) ⇒ String
Constructor Details
#initialize(replace_hash) ⇒ Replacer
Returns a new instance of Replacer.
8 9 10 |
# File 'lib/db_mailer_rails/replacer.rb', line 8 def initialize(replace_hash) self.replace_hash = replace_hash end |
Instance Attribute Details
#replace_hash ⇒ Object
Returns the value of attribute replace_hash.
5 6 7 |
# File 'lib/db_mailer_rails/replacer.rb', line 5 def replace_hash @replace_hash end |
Instance Method Details
#replace(text) ⇒ String
14 15 16 |
# File 'lib/db_mailer_rails/replacer.rb', line 14 def replace(text) Mustache.render(text, replace_hash) end |