lib/rentvine/client.rb in rentvine-0.2.0 vs lib/rentvine/client.rb in rentvine-0.3.0

- old
+ new

@@ -29,10 +29,11 @@ require_relative 'model/file' require_relative 'model/inspection' require_relative 'model/lease' require_relative 'model/ledger' require_relative 'model/owner' +require_relative 'model/owner_distribution' require_relative 'model/portfolio' require_relative 'model/property' require_relative 'model/tenant' require_relative 'model/transaction_entry' require_relative 'model/transaction' @@ -103,17 +104,17 @@ "https://#{@auth[:account_code]}.rentvine.com/api/manager/files", request_params ).run return RentvineError.new(response) unless response.success? - process_rentvine_response(response) + process_rentvine_response(response.body) end - def process_rentvine_response(response) - JSON.parse(response.body, symbolize_names: true).to_snake_keys + def process_rentvine_response(response_body) + JSON.parse(response_body, symbolize_names: true).to_snake_keys rescue - response.body + response_body end def process_request(request_type, url_path, options = {}) options_params = options[:params] || {} request_params = { @@ -130,10 +131,10 @@ "https://#{@auth[:account_code]}.rentvine.com/api/manager/#{url_path}", request_params ).run return RentvineError.new(response) unless response.success? - process_rentvine_response(response) + process_rentvine_response(response.body) end def rentvine_auth_headers { 'Content-Type' => 'application/json', \ No newline at end of file