Class: BotFramework::CardAction

Inherits:
Base
  • Object
show all
Defined in:
lib/bot_framework/models/card_action.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 = {}) ⇒ CardAction

Initializes the object

Parameters:

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

    Model attributes in the form of hash



28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/bot_framework/models/card_action.rb', line 28

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.type = attributes[:type] if attributes.key?(:type)

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

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

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

Instance Attribute Details

#imageObject

URL Picture which will appear on the button, next to text label.



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

def image
  @image
end

#titleObject

Text description which appear on the button.



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

def title
  @title
end

#typeObject

Defines the type of action implemented by this button.



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

def type
  @type
end

#valueObject

Supplementary parameter for action. Content of this property depends on the ActionType



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

def value
  @value
end

Class Method Details

.swagger_typesObject

Attribute mapping from ruby-style variable name to JSON key. Attribute type mapping.



17
18
19
20
21
22
23
24
# File 'lib/bot_framework/models/card_action.rb', line 17

def self.swagger_types
  {
    type: :String,
    title: :String,
    image: :String,
    value: :String
  }
end