diff --git a/lib/zipMoney/response.rb b/lib/zipMoney/response.rb index bd33eb5..5a7ce4e 100644 --- a/lib/zipMoney/response.rb +++ b/lib/zipMoney/response.rb @@ -28,7 +28,8 @@ def toHash # @return OpenStruct def toObject raise ResponseError, "Response body doesnot exist" if @_responseBody.nil? || @_responseBody.empty? - responseObject = JSON.parse(@_responseBody, object_class: OpenStruct) + responseObjectHash = JSON.parse(@_responseBody, object_class: OpenStruct) + responseObject = OpenStruct.new(responseObjectHash) responseObject end