Class: Aws::Lex::Conversation::Type::SessionAttributes

Inherits:
Hash
  • Object
show all
Includes:
Base
Defined in:
lib/aws/lex/conversation/type/session_attributes.rb

Instance Method Summary collapse

Methods included from Base

included

Instance Method Details

#checkpointsObject



12
13
14
15
16
17
18
# File 'lib/aws/lex/conversation/type/session_attributes.rb', line 12

def checkpoints
  @checkpoints ||= JSON.parse(
    Base64.urlsafe_decode64(fetch(:checkpoints) { Base64.urlsafe_encode64([].to_json, padding: false) })
  ).map do |checkpoint|
    Checkpoint.shrink_wrap(checkpoint)
  end
end

#to_lexObject



20
21
22
23
24
# File 'lib/aws/lex/conversation/type/session_attributes.rb', line 20

def to_lex
  merge(
    checkpoints: Base64.urlsafe_encode64(checkpoints.map(&:to_lex).to_json, padding: false)
  ).to_h
end