Class: Roll::Amp::Script::ScriptTag
- Inherits:
-
Object
- Object
- Roll::Amp::Script::ScriptTag
- Includes:
- ActionView::Helpers::OutputSafetyHelper, ActionView::Helpers::TagHelper
- Defined in:
- lib/roll/amp/script/script_tag.rb
Overview
The script tag for embedded scripts.
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(type, content) ⇒ ScriptTag
constructor
Initializes new instance of the script tag.
-
#to_html ⇒ String
Prints this tag as HTML.
Constructor Details
#initialize(type, content) ⇒ ScriptTag
Initializes new instance of the script tag.
14 15 16 17 |
# File 'lib/roll/amp/script/script_tag.rb', line 14 def initialize(type, content) @type = type @content = content end |
Instance Method Details
#to_html ⇒ String
Prints this tag as HTML.
21 22 23 |
# File 'lib/roll/amp/script/script_tag.rb', line 21 def to_html content_tag('script', raw(@content), type: @type) end |