Class: DingBot::Message::Link
Overview
link类型 {
"msgtype": "link",
"link": {
"text": "这个即将发布的新版本,创始人陈航(花名“无招”)称它为“红树林”。
而在此之前,每当面临重大升级,产品经理们都会取一个应景的代号,这一次,为什么是“红树林”?“,
"title": "时代的火车向前开",
"picUrl": "",
"messageUrl": "https://mp.weixin.qq.com/s?__biz=MzA4NjMwMTA2Ng==&mid=2650316842&idx=1&sn=60da3ea2b29f1dcc43a7c8e4a7c97a16&scene=2&srcid=09189AnRJEdIiWVaKltFzNTw&from=timeline&isappinstalled=0&key=&ascene=2&uin=&devicetype=android-23&version=26031933&nettype=WIFI"
}
}
Instance Attribute Summary collapse
-
#message_url ⇒ Object
Returns the value of attribute message_url.
-
#pic_url ⇒ Object
Returns the value of attribute pic_url.
-
#text ⇒ Object
Returns the value of attribute text.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
- #body_params ⇒ Object
-
#initialize(title = '', text = '', message_url = '', pic_url = '') ⇒ Link
constructor
A new instance of Link.
- #msg_type ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(title = '', text = '', message_url = '', pic_url = '') ⇒ Link
Returns a new instance of Link.
17 18 19 20 21 22 |
# File 'lib/dingbot/message/link.rb', line 17 def initialize(title='', text='', ='', pic_url='') @title = title @text = text @message_url = @pic_url = pic_url end |
Instance Attribute Details
#message_url ⇒ Object
Returns the value of attribute message_url.
15 16 17 |
# File 'lib/dingbot/message/link.rb', line 15 def @message_url end |
#pic_url ⇒ Object
Returns the value of attribute pic_url.
15 16 17 |
# File 'lib/dingbot/message/link.rb', line 15 def pic_url @pic_url end |
#text ⇒ Object
Returns the value of attribute text.
15 16 17 |
# File 'lib/dingbot/message/link.rb', line 15 def text @text end |
#title ⇒ Object
Returns the value of attribute title.
15 16 17 |
# File 'lib/dingbot/message/link.rb', line 15 def title @title end |
Instance Method Details
#body_params ⇒ Object
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/dingbot/message/link.rb', line 28 def body_params super.merge( link: { text: @text, title: @title, picUrl: @pic_url, messageUrl: @message_url } ) end |