class ScoutApm::Config::JsonCoercion

If the passed value is a string, attempt to decode as json This is a no-op unless the `JSON` constant is defined

Public Instance Methods

coerce(val) click to toggle source
# File lib/scout_apm/config.rb, line 144
def coerce(val)
  case val
  when String
    if defined?(JSON) && JSON.respond_to?(:parse)
      JSON.parse(val)
    else
      val
    end
  else
    val
  end
end