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 = '', single_title = '', single_url = '', btn_orientation = '0', hide_avatar = '0') ⇒ WholeActionCard

Returns a new instance of WholeActionCard.



35
36
37
38
39
# File 'lib/dingbot/message/action_card.rb', line 35

def initialize(title='', text='', single_title='', single_url='', btn_orientation='0', hide_avatar='0')
  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.



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

def single_title
  @single_title
end

#single_urlObject

Returns the value of attribute single_url.



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

def single_url
  @single_url
end

Instance Method Details

#body_paramsObject



41
42
43
44
45
46
47
48
49
# File 'lib/dingbot/message/action_card.rb', line 41

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