Module: DingBot

Extended by:
Configuration
Defined in:
lib/dingbot.rb,
lib/dingbot/error.rb,
lib/dingbot/client.rb,
lib/dingbot/version.rb,
lib/dingbot/message/base.rb,
lib/dingbot/message/link.rb,
lib/dingbot/message/text.rb,
lib/dingbot/configuration.rb,
lib/dingbot/message/markdown.rb,
lib/dingbot/message/feed_card.rb,
lib/dingbot/message/action_card.rb

Defined Under Namespace

Modules: Configuration, Error, Message Classes: Client

Constant Summary collapse

VERSION =
"0.2.5"

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, extended, options, reset

Class Method Details

.actionsArray<Symbol>

Returns an unsorted array of available client methods.

Returns:

  • (Array<Symbol>)


40
41
42
43
# File 'lib/dingbot.rb', line 40

def self.actions
  hidden = /access_token|post|validate|httparty|secret/
  (DingBot::Client.instance_methods - Object.methods).reject {|e| e[hidden]}
end

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

Alias for DingBot::Client.new

Returns:



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

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

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

Delegate to HTTParty.http_proxy



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

def self.http_proxy(address=nil, port=nil, username=nil, password=nil)
  DingBot::Client.http_proxy(address, port, username, password)
end

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

Delegate to DingBot::Client



22
23
24
25
# File 'lib/dingbot.rb', line 22

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

Delegate to DingBot::Client

Returns:

  • (Boolean)


28
29
30
# File 'lib/dingbot.rb', line 28

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