# 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