Class: Bot::Message::Card
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(to, url, text, suggested_responses = false, options = {}) ⇒ Card
constructor
A new instance of Card.
Methods inherited from Base
Constructor Details
#initialize(to, url, text, suggested_responses = false, options = {}) ⇒ Card
Returns a new instance of Card.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/bot/messages/card.rb', line 4 def initialize(to, url, text, suggested_responses=false, ={}) icon = .delete("icon") self. = { 'type' => 'link', 'to' => to, 'url' => url, 'title' => "", # Displays over the image 'text' => text, # Displays under the image 'attribution' => { 'name' => text # Displays in bottom line }, }.merge() self.['picUrl'] = icon if icon self.['attribution']['iconUrl'] = icon if icon self.['chatId'] = ['chatId'] if ['chatId'] self.suggested_responses = suggested_responses end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Bot::Message::Base