class Sensu::JSON::Java

The Sensu JSON parser when running on JRuby.

Public Instance Methods

dump(object, options={}) click to toggle source

Dump (generate) a JSON string from a Ruby object.

@param object [Object] @param options [Hash]

# File lib/sensu/json/java.rb, line 19
def dump(object, options={})
  if options[:pretty]
    ::JSON.pretty_generate(object)
  else
    ::JSON.fast_generate(object)
  end
end
load(string) click to toggle source

Load (and parse) a JSON string. Sensu expects symbolized keys.

@param string [String] @return [Object]

# File lib/sensu/json/java.rb, line 11
def load(string)
  ::JSON.parse(string, :symbolize_names => true)
end