class Roll::Amp::Script::ScriptTag
The script tag for embedded scripts.
Public Class Methods
new(type, content)
click to toggle source
Initializes new instance of the script tag. @param type [String] the MIME type of the script. @param content [String] the script's content.
# File lib/roll/amp/script/script_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/script/script_tag.rb, line 21 def to_html content_tag('script', raw(@content), type: @type) end