Module: Brat

Extended by:
Configuration
Defined in:
lib/brat.rb,
lib/brat/api.rb,
lib/brat/error.rb,
lib/brat/client.rb,
lib/brat/request.rb,
lib/brat/version.rb,
lib/brat/configuration.rb,
lib/brat/objectified_hash.rb

Defined Under Namespace

Modules: Configuration, Error, Help Classes: API, CLI, Client, ObjectifiedHash, Request, Shell

Constant Summary collapse

VERSION =
"0.1.1"

Constants included from Configuration

Configuration::DEFAULT_USER_AGENT, Configuration::VALID_OPTIONS_KEYS

Class Method Summary collapse

Methods included from Configuration

configure, extended, options, reset

Class Method Details

.actionsArray<Symbol>

Returns an unsorted array of available client methods.

Returns:

  • (Array<Symbol>)


33
34
35
36
# File 'lib/brat.rb', line 33

def self.actions
  hidden = /endpoint|private_token|user_agent|sudo|get|post|put|\Adelete\z|validate|set_request_defaults/
  (Brat::Client.instance_methods - Object.methods).reject {|e| e[hidden]}
end

.client(options = {}) ⇒ Brat::Client

Alias for Brat::Client.new

Returns:



15
16
17
# File 'lib/brat.rb', line 15

def self.client(options={})
  Brat::Client.new(options)
end

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

Delegate to Brat::Client



20
21
22
23
# File 'lib/brat.rb', line 20

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

.respond_to?(method) ⇒ Boolean

Delegate to Brat::Client

Returns:

  • (Boolean)


26
27
28
# File 'lib/brat.rb', line 26

def self.respond_to?(method)
  return client.respond_to?(method) || super
end