Class: ScoutApm::Config::JsonCoercion
- Inherits:
-
Object
- Object
- ScoutApm::Config::JsonCoercion
- Defined in:
- lib/scout_apm/config.rb
Overview
If the passed value is a string, attempt to decode as json This is a no-op unless the ‘JSON` constant is defined
Instance Method Summary collapse
Instance Method Details
#coerce(val) ⇒ Object
153 154 155 156 157 158 159 160 161 162 163 164 |
# File 'lib/scout_apm/config.rb', line 153 def coerce(val) case val when String if defined?(JSON) && JSON.respond_to?(:parse) JSON.parse(val) else val end else val end end |