Method: BotFramework::ConversationParameters#initialize

Defined in:
lib/bot_framework/models/conversation_parameters.rb

#initialize(attributes = {}) ⇒ ConversationParameters

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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

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

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

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

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