Sha256: c27d022759d9525e89c755c73518cedee851cf0cceec4d15fba35ccb6123821c

Contents?: true

Size: 488 Bytes

Versions: 4

Compression:

Stored size: 488 Bytes

Contents

# frozen_string_literal: true

module Sberbank
  module Acquiring
    class Response
      attr_reader :http_response, :request, :data
      alias http http_response

      def initialize(http_response:, request:)
        @http_response = http_response
        @request       = request
        @data          = parse_response_body!
      end

      private

      def parse_response_body!
        JSON.parse(@http_response.body)
      rescue JSON::ParserError
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sberbank-acquiring-1.0.0 lib/sberbank/acquiring/response.rb
sberbank-acquiring-0.2.1 lib/sberbank/acquiring/response.rb
sberbank-acquiring-0.2.0 lib/sberbank/acquiring/response.rb
sberbank-acquiring-0.1.0 lib/sberbank/acquiring/response.rb