Class: CopyTunerClient::Copyray

Inherits:
Object
  • Object
show all
Defined in:
lib/copy_tuner_client/copyray.rb

Class Method Summary collapse

Class Method Details

.augment_template(source, key) ⇒ Object

This:

message

Becomes:

<!--COPYRAY views.home.index.message-->message


7
8
9
10
11
12
13
# File 'lib/copy_tuner_client/copyray.rb', line 7

def self.augment_template(source, key)
  return source if source.blank? || !source.is_a?(String)

  escape = CopyTunerClient.configuration.html_escape && !source.html_safe?
  augmented = "<!--COPYRAY #{key}-->#{escape ? ERB::Util.html_escape(source) : source}"
  augmented.html_safe
end