Class: DingBot::Message::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/dingbot/message/base.rb

Overview

Base Message

Direct Known Subclasses

ActionCard, FeedCard, Link, Markdown, Text

Instance Method Summary collapse

Instance Method Details

#body_paramsObject



20
21
22
23
24
# File 'lib/dingbot/message/base.rb', line 20

def body_params
  {
      msgtype: msg_type
  }
end

#msg_typeObject



16
17
18
# File 'lib/dingbot/message/base.rb', line 16

def msg_type
  # implement inside child
end

#to_jsonObject

Set http post body as json string



27
28
29
# File 'lib/dingbot/message/base.rb', line 27

def to_json
  body_params.to_json
end