class DingBot::Message::ActionCard
ActionCard基类
{ "msgtype": "actionCard", "actionCard": { "title": "乔布斯 20 年前想打造一间苹果咖啡厅,而它正是 Apple Store 的前身", "text": " \n\n #### 乔布斯 20 年前想打造的苹果咖啡厅 \n\n Apple Store 的设计正从原来满满的科技感走向生活化,而其生活化的走向其实可以追溯到 20 年前苹果一个建立咖啡馆的计划", "btnOrientation": "0", "btns": [ { "title": "内容不错", "actionURL": "https://www.dingtalk.com/" }, { "title": "不感兴趣", "actionURL": "https://www.dingtalk.com/" } ] } "at":{ "atMobiles":["137188xxxxx"] }
}
Attributes
at_mobiles[RW]
btn_orientation[RW]
text[RW]
title[RW]
Public Class Methods
new(title='', text='', btn_orientation='0', at_mobiles=[])
click to toggle source
# File lib/dingbot/message/action_card.rb, line 29 def initialize(title='', text='', btn_orientation='0', at_mobiles=[]) @title = title @text = text @btn_orientation = btn_orientation @at_mobiles = at_mobiles end
Public Instance Methods
body_params()
click to toggle source
Calls superclass method
# File lib/dingbot/message/action_card.rb, line 40 def body_params super.merge({ actionCard: { title: @title, text: @text, btnOrientation: @btn_orientation, }, at: { atMobiles: @at_mobiles, } } ) end
msg_type()
click to toggle source
# File lib/dingbot/message/action_card.rb, line 36 def msg_type TYPE::ACTION_CARD end