Sha256: a6346fdd70531e0fde7fcf5a0b9c5bb2d844fa7be9fa7b94b94ddc041ab7e3d3
Contents?: true
Size: 561 Bytes
Versions: 11
Compression:
Stored size: 561 Bytes
Contents
module Paid class APIError < PaidError attr_reader :api_method def initialize(message=nil, api_method=nil) @message = message @api_method = api_method end def code @api_method.response_code if @api_method end def body @api_method.response_body if @api_method end def json begin @api_method.response_json if @api_method rescue APIError nil end end def to_s prefix = code.nil? ? "" : "(Status #{code}) " "#{prefix}#{@message}" end end end
Version data entries
11 entries across 11 versions & 1 rubygems