Module: CFoundry

Defined in:
lib/cfoundry/version.rb,
lib/cfoundry/zip.rb,
lib/cfoundry/client.rb,
lib/cfoundry/errors.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

Overview

:nodoc:

Defined Under Namespace

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

Constant Summary collapse

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

CFoundry library version number.

"0.6.0".freeze

Class Method Summary collapse

Class Method Details

.define_error(class_name, code) ⇒ Object



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

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