Class: BetterAlexaRubyKit::SessionEndedRequest

Inherits:
Request
  • Object
show all
Defined in:
lib/better_alexa_rubykit/session_ended_request.rb

Instance Attribute Summary collapse

Attributes inherited from Request

#json, #locale, #request_id, #session, #type, #version

Instance Method Summary collapse

Methods inherited from Request

#intent_name

Constructor Details

#initialize(json_request) ⇒ SessionEndedRequest

TODO: Validate the reason. We still don’t know if all of the parameters in the request are required. Checking for the presence of intent on an IntentRequest.



9
10
11
12
13
# File 'lib/better_alexa_rubykit/session_ended_request.rb', line 9

def initialize(json_request)
  super
  @type = 'SESSION_ENDED_REQUEST'
  @reason = json_request['request']['reason']
end

Instance Attribute Details

#reasonObject

Returns the value of attribute reason.



4
5
6
# File 'lib/better_alexa_rubykit/session_ended_request.rb', line 4

def reason
  @reason
end

Instance Method Details

#to_sObject

Ouputs the request_id and the reason why.



16
17
18
# File 'lib/better_alexa_rubykit/session_ended_request.rb', line 16

def to_s
  "Session Ended for requestID: #{request_id} with reason #{reason}"
end