Class: Bambora::QueryStringResponse

Inherits:
Response
  • Object
show all
Defined in:
lib/bambora/adapters/query_string_response.rb

Overview

Parses a query string response into a Hash

Constant Summary

Constants inherited from Response

Response::DEFAULT_PARSER

Instance Attribute Summary

Attributes inherited from Response

#response

Instance Method Summary collapse

Methods inherited from Response

#initialize

Constructor Details

This class inherits a constructor from Bambora::Response

Instance Method Details

#to_hObject



7
8
9
10
11
12
# File 'lib/bambora/adapters/query_string_response.rb', line 7

def to_h
  parsed_response = super
  return error_response if parsed_response.values.flatten.empty? # We didn't get a query string back.

  parsed_response.transform_values { |val| val.length == 1 ? val.first : val }
end