lib/dingbot.rb in dingbot-0.1.1 vs lib/dingbot.rb in dingbot-0.2.0
- old
+ new
@@ -1,23 +1,23 @@
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
- ENDPOINT = "https://oapi.dingtalk.com/robot/send"
-
# Alias for DingBot::Client.new
#
# @return [DingBot::Client]
- def self.client(access_token='')
- DingBot::Client.new(access_token)
+ 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)
@@ -36,10 +36,10 @@
# Returns an unsorted array of available client methods.
#
# @return [Array<Symbol>]
def self.actions
- hidden = /access_token|post|validate|set_request_defaults|httparty/
+ hidden = /access_token|post|validate|httparty/
(DingBot::Client.instance_methods - Object.methods).reject {|e| e[hidden]}
end
end