Class: DingBot::Message::FeedCard

Inherits:
Base
  • Object
show all
Defined in:
lib/dingbot/message/feed_card.rb

Overview

FeedCard类型

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#to_json

Constructor Details

#initialize(links = []) ⇒ FeedCard

Returns a new instance of FeedCard.



8
9
10
# File 'lib/dingbot/message/feed_card.rb', line 8

def initialize(links=[])
  @links = links
end

Instance Attribute Details

Returns the value of attribute links.



6
7
8
# File 'lib/dingbot/message/feed_card.rb', line 6

def links
  @links
end

Instance Method Details

#body_paramsObject



16
17
18
19
20
# File 'lib/dingbot/message/feed_card.rb', line 16

def body_params
  super.merge(feedCard: {
      links: @links.map {|link| link.format}
  })
end

#msg_typeObject



12
13
14
# File 'lib/dingbot/message/feed_card.rb', line 12

def msg_type
  TYPE::FEED_CARD
end