14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/cm_tag/campaign_process.rb', line 14
def update_tags(html, params = {}, replace_tags = false)
raise ArgumentError, "Argument [params] cannot be empty" unless params.length > 0
raise ArgumentError, "Argument [html] cannot be empty" if html.rstrip == ""
self.find_all(html)
html = self.update_campaign_tags(html, params, (@description_tags.nil? && []) || @description_tags)
html = self.update_campaign_tags(html, params, (@title_tags.nil? && []) || @title_tags)
html = self.update_campaign_tags(html, params, (@imgsrc_tags.nil? && []) || @imgsrc_tags)
html = self.update_campaign_tags(html, params, (@linkhref_tags.nil? && []) || @linkhref_tags)
puts "replace tags #{replace_tags}"
if replace_tags
html = self.transform_campaign_to_html_tags(html, params, (@description_tags.nil? && []) || @description_tags)
html = self.transform_campaign_to_html_tags(html, params, (@title_tags.nil? && []) || @title_tags)
html = self.transform_campaign_to_html_tags(html, params, (@imgsrc_tags.nil? && []) || @imgsrc_tags)
html = self.transform_campaign_to_html_tags(html, params, (@linkhref_tags.nil? && []) || @linkhref_tags)
end
html
end
|