Class: BotFramework::AttachmentInfo

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

Overview

Metdata for an attachment

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 = {}) ⇒ AttachmentInfo

Initializes the object

Parameters:

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

    Model attributes in the form of hash



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/bot_framework/models/attachment_info.rb', line 24

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

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

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

Instance Attribute Details

#nameObject

Name of the attachment



5
6
7
# File 'lib/bot_framework/models/attachment_info.rb', line 5

def name
  @name
end

#typeObject

ContentType of the attachment



8
9
10
# File 'lib/bot_framework/models/attachment_info.rb', line 8

def type
  @type
end

#viewsObject

attachment views



11
12
13
# File 'lib/bot_framework/models/attachment_info.rb', line 11

def views
  @views
end

Class Method Details

.swagger_typesObject

Attribute type mapping.



14
15
16
17
18
19
20
# File 'lib/bot_framework/models/attachment_info.rb', line 14

def self.swagger_types
  {
    name: :String,
    type: :String,
    views: :'Array<AttachmentView>'
  }
end