Sha256: 9c1da08eb0e45472e0014823e30ae04d9e2d1b7f5a807acc9e4ab19e370ea817

Contents?: true

Size: 400 Bytes

Versions: 8

Compression:

Stored size: 400 Bytes

Contents

module Chargify
  module ResponseHelper
    private
    def process_capturing_errors(&block)
      begin
        yield if block_given?
      rescue ActiveResource::ResourceInvalid => error
        if :xml == Chargify.format.to_sym
          self.errors.from_xml(error.response.body)
        else
          self.errors.from_json(error.response.body)
        end
      end
      self
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
chargify_api_ares-1.3.3 lib/chargify_api_ares/response_helper.rb
chargify_api_ares-1.3.2 lib/chargify_api_ares/response_helper.rb
chargify_api_ares-1.3.1 lib/chargify_api_ares/response_helper.rb
chargify_api_ares-1.3.0 lib/chargify_api_ares/response_helper.rb
chargify_api_ares-1.2.1 lib/chargify_api_ares/response_helper.rb
chargify_api_ares-1.1.0 lib/chargify_api_ares/response_helper.rb
chargify_api_ares-1.1.0.pre lib/chargify_api_ares/response_helper.rb
chargify_api_ares-1.0.5 lib/chargify_api_ares/response_helper.rb