Sha256: 629c2f16dc54ca6eaf3c045a3a85e4b88172569a4251f6529e7e4f09ccf6a96c

Contents?: true

Size: 1.19 KB

Versions: 4

Compression:

Stored size: 1.19 KB

Contents

require "dingbot/version"
require 'dingbot/error'
require 'dingbot/client'
require 'dingbot/configuration'
require 'dingbot/message/text'
require 'dingbot/message/link'
require 'dingbot/message/markdown'
require 'dingbot/message/action_card'
require 'dingbot/message/feed_card'

module DingBot
  extend Configuration

  # Alias for DingBot::Client.new
  #
  # @return [DingBot::Client]
  def self.client(options={})
    DingBot::Client.new(options)
  end

  # Delegate to DingBot::Client
  def self.method_missing(method, *args, &block)
    return super unless client.respond_to?(method)
    client.send(method, *args, &block)
  end

  # Delegate to DingBot::Client
  def respond_to_missing?(method_name, include_private = false)
    client.respond_to?(method_name) || super
  end

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

  # Returns an unsorted array of available client methods.
  #
  # @return [Array<Symbol>]
  def self.actions
    hidden = /access_token|post|validate|httparty/
    (DingBot::Client.instance_methods - Object.methods).reject {|e| e[hidden]}
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dingbot-0.2.3 lib/dingbot.rb
dingbot-0.2.2 lib/dingbot.rb
dingbot-0.2.1 lib/dingbot.rb
dingbot-0.2.0 lib/dingbot.rb