Class: BotFramework::ThumbnailCard

Inherits:
Base
  • Object
show all
Defined in:
lib/bot_framework/models/thumbnail_card.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#==, #_deserialize, #_to_hash, #as_json, attr_accessor, attribute_map, #attributes, #attributes_hash, #build_from_hash, #compact_attributes_hash, #eql?, #hash, #list_invalid_properties, #to_body, #to_hash, #to_json, #to_s, #valid?

Constructor Details

#initialize(attributes = {}) ⇒ ThumbnailCard

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/bot_framework/models/thumbnail_card.rb', line 35

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.title = attributes[:title] if attributes.key?(:title)

  self.subtitle = attributes[:subtitle] if attributes.key?(:subtitle)

  self.text = attributes[:text] if attributes.key?(:text)

  if attributes.key?(:images)
    if (value = attributes[:images]).is_a?(Array)
      self.images = value
    end
  end

  if attributes.key?(:buttons)
    if (value = attributes[:buttons]).is_a?(Array)
      self.buttons = value
    end
  end

  self.tap = attributes[:tap] if attributes.key?(:tap)
end

Instance Attribute Details

#buttonsObject

Set of actions applicable to the current card



16
17
18
# File 'lib/bot_framework/models/thumbnail_card.rb', line 16

def buttons
  @buttons
end

#imagesObject

Array of i



13
14
15
# File 'lib/bot_framework/models/thumbnail_card.rb', line 13

def images
  @images
end

#subtitleObject

Subtitle of the card



7
8
9
# File 'lib/bot_framework/models/thumbnail_card.rb', line 7

def subtitle
  @subtitle
end

#tapObject

This action will be activated when user taps on the card itself



19
20
21
# File 'lib/bot_framework/models/thumbnail_card.rb', line 19

def tap
  @tap
end

#textObject

Text for the card



10
11
12
# File 'lib/bot_framework/models/thumbnail_card.rb', line 10

def text
  @text
end

#titleObject

Title of the card



4
5
6
# File 'lib/bot_framework/models/thumbnail_card.rb', line 4

def title
  @title
end

Class Method Details

.swagger_typesObject

Attribute type mapping.



22
23
24
25
26
27
28
29
30
31
# File 'lib/bot_framework/models/thumbnail_card.rb', line 22

def self.swagger_types
  {
    title: :String,
    subtitle: :String,
    text: :String,
    images: :'Array<CardImage>',
    buttons: :'Array<CardAction>',
    tap: :CardAction
  }
end