Module: Opendistro

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

Defined Under Namespace

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

Constant Summary collapse

VERSION =
'1.0.0'

Constants included from Configuration

Configuration::DEFAULT_USER_AGENT, Configuration::DEFAULT_VERIFY_SSL, 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>)


42
43
44
45
46
# File 'lib/opendistro.rb', line 42

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

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

Alias for Opendistro::Client.new

Returns:



18
19
20
# File 'lib/opendistro.rb', line 18

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

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

Delegate to HTTParty.http_proxy



35
36
37
# File 'lib/opendistro.rb', line 35

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

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

Delegate to Opendistro::Client



23
24
25
26
27
# File 'lib/opendistro.rb', line 23

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

  client.send(method, *args, &block)
end

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

Delegate to Opendistro::Client

Returns:

  • (Boolean)


30
31
32
# File 'lib/opendistro.rb', line 30

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