Class: DingBot::Message::IndependentActionCard
- Inherits:
-
ActionCard
- Object
- Base
- ActionCard
- DingBot::Message::IndependentActionCard
- Defined in:
- lib/dingbot/message/action_card.rb
Overview
独立跳转ActionCard类型
Instance Attribute Summary collapse
-
#buttons ⇒ Object
Returns the value of attribute buttons.
Attributes inherited from ActionCard
#btn_orientation, #hide_avatar, #text, #title
Instance Method Summary collapse
- #body_params ⇒ Object
-
#initialize(title = '', text = '', btn_orientation = '0', hide_avatar = '0', buttons = []) ⇒ IndependentActionCard
constructor
A new instance of IndependentActionCard.
Methods inherited from ActionCard
Methods inherited from Base
Constructor Details
#initialize(title = '', text = '', btn_orientation = '0', hide_avatar = '0', buttons = []) ⇒ IndependentActionCard
Returns a new instance of IndependentActionCard.
52 53 54 55 |
# File 'lib/dingbot/message/action_card.rb', line 52 def initialize(title='', text='', btn_orientation='0', hide_avatar='0', =[]) super(title, text, btn_orientation, hide_avatar) @buttons = end |
Instance Attribute Details
#buttons ⇒ Object
Returns the value of attribute buttons.
50 51 52 |
# File 'lib/dingbot/message/action_card.rb', line 50 def @buttons end |
Instance Method Details
#body_params ⇒ Object
57 58 59 60 |
# File 'lib/dingbot/message/action_card.rb', line 57 def body_params action_card = super[:actionCard].merge(btns: @buttons.map {|btn| btn.format}) super.merge(actionCard: action_card) end |