Module: RubyShift

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

Defined Under Namespace

Modules: Configuration, Error Classes: API, Client, Request

Constant Summary collapse

VERSION =
"0.1.0"

Constants included from Configuration

Configuration::DEFAULT_ENDPOINT, Configuration::DEFAULT_USER_AGENT, Configuration::VALID_OPTIONS_KEYS

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Configuration

configure, exetended, options, reset

Class Method Details

.actionsObject

Return an array of available client methods



31
32
33
34
# File 'lib/rubyshift.rb', line 31

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

.client(options = {}) ⇒ Object



11
12
13
# File 'lib/rubyshift.rb', line 11

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

.http_proxy(address = nil, port = nil, username = nil, password = nil) ⇒ Object

Delegate to HTTParty.http_proxy



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

def self.http_proxy(address=nil, port=nil, username=nil, password=nil)
  RubyShift::Request.http_proxy(address, port, username, password)
end

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

Delegate to RubyShift::Client



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

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

Instance Method Details

#respond_to_missing?(method_name, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


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

def respond_to_missing?(method_name, include_private = false)
  client.respond_to?(method_name) || super
end