Sha256: 333f5aa9f9031384c93075e9ed53202dc4a0884191b629f07b6d9e8c7a2565a7
Contents?: true
Size: 958 Bytes
Versions: 1
Compression:
Stored size: 958 Bytes
Contents
module Finix class ResourceErrors < ::StandardError attr_reader :response attr_reader :errors def initialize(response=nil) @response = response @errors = [] @response[:body]['_embedded']['errors'].each { |error| @errors.push Finix::ResourceError.new error} end def to_s "#{@errors}" end def inspect to_s end end class ResourceError < ::StandardError attr_reader :attributes def initialize(error = {}) @attributes = {} @attributes = @attributes.merge error end def to_s "#{self.class.name.split('::').last || ''} #{@attributes}" end end class BadRequest < ResourceErrors; end class Unauthorized < ResourceErrors; end class Forbidden < ResourceErrors; end class NotFound < ResourceErrors; end class MethodNotAllowed < ResourceErrors; end class UnprocessableEntity < ResourceErrors; end class ServerError < ResourceErrors; end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
finix-0.12 | lib/finix/error.rb |