Class: RawJavascript
- Inherits:
-
Object
- Object
- RawJavascript
- Defined in:
- lib/jirametrics/raw_javascript.rb
Overview
When strings are serialized into JSON, they’re converted to actual strings. The purpose of this class is to allow raw javascript to be passed through.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(content) ⇒ RawJavascript
constructor
A new instance of RawJavascript.
- #to_json(*_args) ⇒ Object
Constructor Details
#initialize(content) ⇒ RawJavascript
Returns a new instance of RawJavascript.
6 7 8 |
# File 'lib/jirametrics/raw_javascript.rb', line 6 def initialize content @content = content end |
Instance Method Details
#==(other) ⇒ Object
14 15 16 |
# File 'lib/jirametrics/raw_javascript.rb', line 14 def == other other.is_a?(RawJavascript) && to_json == other.to_json end |
#to_json(*_args) ⇒ Object
10 11 12 |
# File 'lib/jirametrics/raw_javascript.rb', line 10 def to_json(*_args) @content end |