lib/ragios-client.rb in ragios-client-0.0.7 vs lib/ragios-client.rb in ragios-client-0.1.0
- old
+ new
@@ -1,7 +1,7 @@
require 'rest_client'
-require 'json/pure'
+require 'multi_json'
require 'uri'
module Ragios
class ClientException < StandardError; end
@@ -107,14 +107,14 @@
def address_port
"#{@address}:#{@port}"
end
def generate_json(str)
- JSON.generate(str)
+ MultiJson.dump(str)
end
def parse_json(str)
- JSON.parse(str, symbolize_names: true)
+ MultiJson.load(str, symbolize_names: true)
end
def auth_session
return "" if [@username, @password].any? { |e| e.nil? }
auth = RestClient.post "#{address_port}/session", { :username=> @username, :password => @password}