Class: Dingtalk::Robot
- Inherits:
-
Object
- Object
- Dingtalk::Robot
- Includes:
- Configurable
- Defined in:
- lib/dingtalk/robot.rb,
lib/dingtalk/robot/errors.rb,
lib/dingtalk/robot/version.rb,
lib/dingtalk/robot/configurable.rb,
lib/dingtalk/robot/strategies/text_strategy.rb,
lib/dingtalk/robot/strategies/markdown_strategy.rb
Overview
DingTalk Group Robot
Defined Under Namespace
Modules: Configurable Classes: ConfigurationError, Error, MarkdownStrategy, TextStrategy
Constant Summary collapse
- VERSION =
'0.2.0'- VALID_MESSAGE_TYPES =
Dir["#{__dir__}/strategies/*"].map { |path| File.basename(path, '_strategy.rb').to_sym }
- WEBHOOK_BASE_URL =
'https://oapi.dingtalk.com/robot/send?access_token='
Instance Method Summary collapse
-
#initialize(channel, message_type = nil, &context_block) ⇒ Robot
constructor
A new instance of Robot.
Methods included from Configurable
Constructor Details
#initialize(channel, message_type = nil, &context_block) ⇒ Robot
Returns a new instance of Robot.
28 29 30 31 32 |
# File 'lib/dingtalk/robot.rb', line 28 def initialize(channel, = nil, &context_block) @channel = channel.to_sym self. = &.to_sym @context_block = context_block end |