Class: Roll::Amp::Script::JsonScriptTag

Inherits:
ScriptTag
  • Object
show all
Defined in:
lib/roll/amp/script/json_script_tag.rb

Overview

The script tag that contains JSON.

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ScriptTag

#to_html

Constructor Details

#initialize(content) ⇒ JsonScriptTag

Initializes script tag instance.

Parameters:

  • content (String)

    the content of the tag.



8
9
10
# File 'lib/roll/amp/script/json_script_tag.rb', line 8

def initialize(content)
  super(JsonScriptTag.type, content)
end

Class Method Details

.typeString

Returns JSON MIME type.

Returns:

  • (String)

    JSON MIME type.



13
14
15
# File 'lib/roll/amp/script/json_script_tag.rb', line 13

def self.type
  'application/json'.freeze
end