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/baseclient.rb,
lib/cfoundry/chatty_hash.rb,
lib/cfoundry/upload_helpers.rb

Overview

:nodoc:

Defined Under Namespace

Modules: UploadHelpers, V1, V2, Zip Classes: APIError, BadResponse, BaseClient, ChattyHash, Client, Denied, Deprecated, Error, Mismatch, NotFound, TargetRefused, UAAClient

Constant Summary collapse

VERSION =

CFoundry library version number.

"0.3.61"

Class Method Summary collapse

Class Method Details

.define_error(class_name, v2_code, v1_code = nil) ⇒ Object



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/cfoundry/errors.rb', line 73

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

  klass = Class.new(base)

  APIError.v1_classes[v1_code] = klass if v1_code
  APIError.v2_classes[v2_code] = klass if v2_code

  const_set(class_name, klass)
end