Module: CFoundry

Defined in:
lib/cfoundry/client.rb,
lib/cfoundry/zip.rb,
lib/cfoundry/errors.rb,
lib/cfoundry/v2/user.rb,
lib/cfoundry/version.rb,
lib/cfoundry/uaaclient.rb,
lib/cfoundry/validator.rb,
lib/cfoundry/auth_token.rb,
lib/cfoundry/baseclient.rb,
lib/cfoundry/chatty_hash.rb,
lib/cfoundry/rest_client.rb,
lib/cfoundry/trace_helpers.rb,
lib/cfoundry/upload_helpers.rb,
lib/cfoundry/concerns/login_helpers.rb,
lib/cfoundry/concerns/proxy_options.rb,
lib/cfoundry/v2/model_magic/client_extensions.rb

Overview

:nodoc:

Defined Under Namespace

Modules: LoginHelpers, ProxyOptions, TraceHelpers, UploadHelpers, V2, Validator, Zip Classes: APIError, AuthToken, BadResponse, BaseClient, ChattyHash, Client, Denied, Deprecated, Error, InvalidTarget, Mismatch, NotFound, RestClient, TargetRefused, Timeout, UAAClient, UAAError, Unauthorized

Constant Summary collapse

VENDOR_DIR =
File.expand_path("../../../vendor", __FILE__)
VERSION =

CFoundry library version number.

"4.7.1".freeze

Class Method Summary collapse

Class Method Details

.define_error(class_name, code) ⇒ Object



133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# File 'lib/cfoundry/errors.rb', line 133

def self.define_error(class_name, code)
  base =
    case class_name
    when /NotFound$/
      NotFound
    else
      APIError
    end

  klass =
    if const_defined?(class_name)
      const_get(class_name)
    else
      Class.new(base)
    end

  APIError.error_classes[code] = klass

  unless const_defined?(class_name)
    const_set(class_name, klass)
  end
end