Sha256: 3fd0f5cc231b04ff3ccddb21512ef84b102fcbcb0ff784433e45c95ae72f02ad
Contents?: true
Size: 427 Bytes
Versions: 15
Compression:
Stored size: 427 Bytes
Contents
require 'rest_client' module CobotClient module Exceptions EXCEPTIONS_MAP = {} end class Exception < RestClient::Exception end RestClient::STATUSES.each_pair do |code, message| superclass = RestClient::Exceptions::EXCEPTIONS_MAP.fetch code klass = Class.new(superclass) klass_constant = const_set message.delete(' \-\''), klass Exceptions::EXCEPTIONS_MAP[superclass] = klass_constant end end
Version data entries
15 entries across 15 versions & 1 rubygems