Sha256: dc75777b0bc8082e07009c7608d03544b4d5c261db122f25dd86447d433ccf2f

Contents?: true

Size: 413 Bytes

Versions: 1

Compression:

Stored size: 413 Bytes

Contents

# frozen_string_literal: true

require 'forwardable'
require 'json'

module WellsFargo
  class Response
    extend Forwardable

    attr_reader :raw_response

    def_delegators :body, :[]

    def initialize(raw_response)
      @raw_response = raw_response
    end

    def body
      @body ||= JSON.parse(raw_response.body, symbolize: true)
    end

    def success?
      !body.key?(:errors)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wells_fargo-api-0.1.0 lib/wells_fargo/response.rb