Class: AlexaRuby::Alexa
- Inherits:
-
Object
- Object
- AlexaRuby::Alexa
- Defined in:
- lib/alexa_ruby/alexa.rb
Overview
Main processing class, parses request from Amazon Alexa and initialize new response object
Instance Attribute Summary collapse
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(request, opts) ⇒ Alexa
constructor
Initialize new Alexa assistant.
Constructor Details
#initialize(request, opts) ⇒ Alexa
Initialize new Alexa assistant
12 13 14 15 16 17 18 19 20 |
# File 'lib/alexa_ruby/alexa.rb', line 12 def initialize(request, opts) @req = request @opts = opts invalid_request_exception if invalid_request? @request = define_request raise ArgumentError, 'Unknown type of Alexa request' if @request.nil? @request.valid? if ssl_check? @response = Response.new(@request.type, @request.version) end |
Instance Attribute Details
#request ⇒ Object (readonly)
Returns the value of attribute request.
5 6 7 |
# File 'lib/alexa_ruby/alexa.rb', line 5 def request @request end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
5 6 7 |
# File 'lib/alexa_ruby/alexa.rb', line 5 def response @response end |