Module: Capgun

Extended by:
Config
Defined in:
lib/capgun.rb,
lib/capgun/job.rb,
lib/capgun/base.rb,
lib/capgun/error.rb,
lib/capgun/order.rb,
lib/capgun/client.rb,
lib/capgun/config.rb,
lib/capgun/account.rb,
lib/capgun/request.rb,
lib/capgun/version.rb,
lib/capgun/estimate.rb,
lib/capgun/creatable.rb,
lib/capgun/connection.rb,
lib/capgun/error/forbidden.rb,
lib/capgun/error/not_found.rb,
lib/capgun/request/gateway.rb,
lib/capgun/error/bad_gateway.rb,
lib/capgun/error/bad_request.rb,
lib/capgun/error/client_error.rb,
lib/capgun/error/server_error.rb,
lib/capgun/error/unauthorized.rb,
lib/capgun/response/parse_json.rb,
lib/capgun/error/not_acceptable.rb,
lib/capgun/error/service_unavailable.rb,
lib/capgun/error/internal_server_error.rb,
lib/capgun/response/raise_client_error.rb,
lib/capgun/response/raise_server_error.rb

Defined Under Namespace

Modules: Config, Connection, Creatable, Request, Response Classes: Account, Base, Client, Error, Estimate, Job, Order, Version

Constant Summary

Constants included from Config

Config::DEFAULT_ADAPTER, Config::DEFAULT_AUTH_TOKEN, Config::DEFAULT_CONNECTION_OPTIONS, Config::DEFAULT_ENDPOINT, Config::DEFAULT_GATEWAY, Config::DEFAULT_PROXY, Config::DEFAULT_USER_AGENT, Config::VALID_OPTIONS_KEYS

Class Method Summary collapse

Methods included from Config

configure, extended, options, reset

Class Method Details

.method_missing(method, *args, &block) ⇒ Object

Delegate methods to Capgun::Client



21
22
23
24
# File 'lib/capgun.rb', line 21

def method_missing(method, *args, &block)
  return super unless new.respond_to?(method)
  new.send(method, *args, &block)
end

.new(options = {}) ⇒ Capgun::Client

Alias for Capgun::Client.new

Parameters:

  • options (Hash) (defaults to: {})

    options for the Capgun::Client

Returns:



16
17
18
# File 'lib/capgun.rb', line 16

def new(options={})
  Capgun::Client.new(options)
end

.respond_to?(method, include_private = false) ⇒ Boolean

Corollary of #method_missing delegated to Capgun::Client

Returns:

  • (Boolean)


27
28
29
# File 'lib/capgun.rb', line 27

def respond_to?(method, include_private=false)
  new.respond_to?(method, include_private) || super(method, include_private)
end