Class: DbMailerRails::Replacer

Inherits:
Object
  • Object
show all
Defined in:
lib/db_mailer_rails/replacer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(replace_hash) ⇒ Replacer

Returns a new instance of Replacer.

Parameters:

  • replace_hash (Hash)


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_hashObject

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

Parameters:

Returns:

  • (String)


14
15
16
# File 'lib/db_mailer_rails/replacer.rb', line 14

def replace(text)
  Mustache.render(text, replace_hash)
end