Module: Aws::Lex::Conversation::Type::Base::InstanceMethods

Defined in:
lib/aws/lex/conversation/type/base.rb

Instance Method Summary collapse

Instance Method Details

#assign_attributes!(opts = {}) ⇒ Object



21
22
23
24
25
26
# File 'lib/aws/lex/conversation/type/base.rb', line 21

def assign_attributes!(opts = {})
  attributes = self.class.attributes | self.class.virtual_attributes
  attributes.each do |attribute|
    instance_variable_set("@#{attribute}", opts[attribute])
  end
end

#to_lexObject



28
29
30
31
32
33
34
# File 'lib/aws/lex/conversation/type/base.rb', line 28

def to_lex
  output = self.class.attributes.each_with_object({}) do |attribute, hash|
    value = transform_to_lex(public_send(attribute))
    hash[self.class.mapping.fetch(attribute)] = value
  end
  output.compact
end