Module: Castle

Defined in:
lib/castle.rb,
lib/castle/api.rb,
lib/castle/utils.rb,
lib/castle/client.rb,
lib/castle/errors.rb,
lib/castle/review.rb,
lib/castle/command.rb,
lib/castle/request.rb,
lib/castle/version.rb,
lib/castle/response.rb,
lib/castle/secure_mode.rb,
lib/castle/utils/cloner.rb,
lib/castle/utils/merger.rb,
lib/castle/configuration.rb,
lib/castle/extractors/ip.rb,
lib/castle/support/rails.rb,
lib/castle/commands/track.rb,
lib/castle/context_merger.rb,
lib/castle/support/hanami.rb,
lib/castle/commands/review.rb,
lib/castle/default_context.rb,
lib/castle/header_formatter.rb,
lib/castle/commands/identify.rb,
lib/castle/extractors/headers.rb,
lib/castle/extractors/client_id.rb,
lib/castle/commands/authenticate.rb,
lib/castle/commands/with_context.rb,
lib/castle/failover_auth_response.rb

Overview

main sdk module

Defined Under Namespace

Modules: CastleClient, Commands, Extractors, Hanami, SecureMode, Utils Classes: API, ApiError, BadRequestError, Client, Command, Configuration, ConfigurationError, ContextMerger, DefaultContext, Error, FailoverAuthResponse, ForbiddenError, HeaderFormatter, InternalServerError, InvalidParametersError, NotFoundError, Request, RequestError, Response, Review, SecurityError, UnauthorizedError, UserUnauthorizedError

Constant Summary collapse

VERSION =
'3.2.0'

Class Method Summary collapse

Class Method Details

.api_secret=(api_secret) ⇒ Object



48
49
50
# File 'lib/castle.rb', line 48

def api_secret=(api_secret)
  config.api_secret = api_secret
end

.configObject



44
45
46
# File 'lib/castle.rb', line 44

def config
  @configuration ||= Castle::Configuration.new
end

.configure(config_hash = nil) {|config| ... } ⇒ Object

Yields:



36
37
38
39
40
41
42
# File 'lib/castle.rb', line 36

def configure(config_hash = nil)
  (config_hash || {}).each do |config_name, config_value|
    config.send("#{config_name}=", config_value)
  end

  yield(config) if block_given?
end