Class: BotFramework::Fact

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

Overview

Set of key-value pairs. Advantage of this section is that key and value properties will be rendered with default style information with some delimiter between them. So there is no need for developer to specify style information.

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

Initializes the object

Parameters:

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

    Model attributes in the form of hash



18
19
20
21
22
23
24
25
26
27
# File 'lib/bot_framework/models/fact.rb', line 18

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

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

Instance Attribute Details

#keyObject

Returns the value of attribute key.



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

def key
  @key
end

#valueObject

Returns the value of attribute value.



6
7
8
# File 'lib/bot_framework/models/fact.rb', line 6

def value
  @value
end

Class Method Details

.swagger_typesObject

Attribute type mapping.



9
10
11
12
13
14
# File 'lib/bot_framework/models/fact.rb', line 9

def self.swagger_types
  {
    key: :String,
    value: :String
  }
end