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" +
"> \n" +
"> ###### 10点20分发布 [天气](http://www.thinkpage.cn/) \n"
}
}
Instance Attribute Summary collapse
-
#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 = '') ⇒ Markdown
constructor
A new instance of Markdown.
- #msg_type ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(title = '', text = '') ⇒ Markdown
Returns a new instance of Markdown.
18 19 20 21 |
# File 'lib/dingbot/message/markdown.rb', line 18 def initialize(title='', text='') @title = title @text = text end |
Instance Attribute Details
#text ⇒ Object
Returns the value of attribute text.
16 17 18 |
# File 'lib/dingbot/message/markdown.rb', line 16 def text @text end |
#title ⇒ Object
Returns the value of attribute title.
16 17 18 |
# File 'lib/dingbot/message/markdown.rb', line 16 def title @title end |
Instance Method Details
#body_params ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/dingbot/message/markdown.rb', line 27 def body_params super.merge( markdown: { text: @text, title: @title, } ) end |