class Roll::Amp::Html::AnalyticsTag

The amp-analytics tag.

Public Class Methods

new(type, content) click to toggle source

Initializes new instance of the analytics tag. @param type [String] the type of AMP analytics. @param content [String] the content of the tag.

# File lib/roll/amp/html/analytics_tag.rb, line 14
def initialize(type, content)
  @type = type
  @content = content
end

Public Instance Methods

to_html() click to toggle source

Prints this tag as HTML. @return [String] HTML-safe string containing the tag's HTML view.

# File lib/roll/amp/html/analytics_tag.rb, line 21
def to_html
  content_tag('amp-analytics', raw(@content), type: @type)
end