Class: Rollbar::JSON::Value
- Inherits:
-
Object
- Object
- Rollbar::JSON::Value
- Defined in:
- lib/rollbar/middleware/js/json_value.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(value) ⇒ Value
constructor
A new instance of Value.
- #to_json(opts = {}) ⇒ Object
Constructor Details
#initialize(value) ⇒ Value
Returns a new instance of Value.
23 24 25 |
# File 'lib/rollbar/middleware/js/json_value.rb', line 23 def initialize(value) @value = value end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
21 22 23 |
# File 'lib/rollbar/middleware/js/json_value.rb', line 21 def value @value end |
Instance Method Details
#to_json(opts = {}) ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/rollbar/middleware/js/json_value.rb', line 27 def to_json(opts = {}) # Return the raw value if this is from the js middleware return value if opts.class == Rollbar::JSON::JsOptionsState # Otherwise convert to a string %Q["#{value}"] end |