Class: DingBot::Message::Markdown
- Defined in:
- lib/dingbot/message/markdown.rb
Overview
markdown类型 {
"msgtype": "markdown",
"markdown": {
"title":"杭州天气",
"text": "#### 杭州天气\n" +
"> 9度,西北风1级,空气良89,相对温度73%\n\n" +
"> ![screenshot](http://image.jpg)\n" +
"> ###### 10点20分发布 [天气](http://www.thinkpage.cn/) \n"
},
"at": {
"atMobiles": [
"1825718XXXX"
],
"isAtAll": false
}
}
Instance Attribute Summary collapse
-
#at_mobiles ⇒ Object
Returns the value of attribute at_mobiles.
-
#is_at_all ⇒ Object
Returns the value of attribute is_at_all.
-
#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 = '', at_mobiles = [], is_at_all = false) ⇒ Markdown
constructor
A new instance of Markdown.
- #msg_type ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(title = '', text = '', at_mobiles = [], is_at_all = false) ⇒ Markdown
Returns a new instance of Markdown.
24 25 26 27 28 29 |
# File 'lib/dingbot/message/markdown.rb', line 24 def initialize(title='', text='', at_mobiles=[], is_at_all=false) @title = title @text = text @at_mobiles = at_mobiles @is_at_all = is_at_all end |
Instance Attribute Details
#at_mobiles ⇒ Object
Returns the value of attribute at_mobiles.
22 23 24 |
# File 'lib/dingbot/message/markdown.rb', line 22 def at_mobiles @at_mobiles end |
#is_at_all ⇒ Object
Returns the value of attribute is_at_all.
22 23 24 |
# File 'lib/dingbot/message/markdown.rb', line 22 def is_at_all @is_at_all end |
#text ⇒ Object
Returns the value of attribute text.
22 23 24 |
# File 'lib/dingbot/message/markdown.rb', line 22 def text @text end |
#title ⇒ Object
Returns the value of attribute title.
22 23 24 |
# File 'lib/dingbot/message/markdown.rb', line 22 def title @title end |
Instance Method Details
#body_params ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/dingbot/message/markdown.rb', line 35 def body_params super.merge({ markdown: { text: @text, title: @title, }, at: { atMobiles: @at_mobiles, isAtAll: @is_at_all } } ) end |