Class: RawJavascript

Inherits:
Object
  • Object
show all
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

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