Class: DingBot::Message::WholeActionCard

Inherits:
ActionCard show all
Defined in:
lib/dingbot/message/action_card.rb

Overview

整体跳转ActionCard类型

Instance Attribute Summary collapse

Attributes inherited from ActionCard

#btn_orientation, #hide_avatar, #text, #title

Instance Method Summary collapse

Methods inherited from ActionCard

#msg_type

Methods inherited from Base

#msg_type, #to_json

Constructor Details

#initialize(title = '', text = '', btn_orientation = '0', hide_avatar = '0', single_title = '', single_url = '') ⇒ WholeActionCard

Returns a new instance of WholeActionCard.



33
34
35
36
37
# File 'lib/dingbot/message/action_card.rb', line 33

def initialize(title='', text='', btn_orientation='0', hide_avatar='0', single_title='', single_url='')
  super(title, text, btn_orientation, hide_avatar)
  @single_title = single_title
  @single_url = single_url
end

Instance Attribute Details

#single_titleObject

Returns the value of attribute single_title.



31
32
33
# File 'lib/dingbot/message/action_card.rb', line 31

def single_title
  @single_title
end

#single_urlObject

Returns the value of attribute single_url.



31
32
33
# File 'lib/dingbot/message/action_card.rb', line 31

def single_url
  @single_url
end

Instance Method Details

#body_paramsObject



39
40
41
42
43
44
45
# File 'lib/dingbot/message/action_card.rb', line 39

def body_params
  action_card = super[:actionCard].merge({
                                             singleTitle: @single_title,
                                             singleURL: @single_url
                                         })
  super.merge(actionCard: action_card)
end