Class: ActionAlexa::Intent::Base
- Inherits:
-
Object
- Object
- ActionAlexa::Intent::Base
- Includes:
- Authorization
- Defined in:
- lib/action_alexa/intent/base.rb
Overview
Base Intent class which provides some basic sanity methods
for the Skill intents defined by the application
Constant Summary collapse
- AMAZON_API_URL =
'https://api.amazon.com/user/profile'
Class Attribute Summary collapse
-
.name ⇒ Object
Returns the value of attribute name.
Instance Attribute Summary collapse
-
#alexa_payload ⇒ Object
readonly
Returns the value of attribute alexa_payload.
-
#alexa_response ⇒ Object
readonly
Returns the value of attribute alexa_response.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(alexa_payload) ⇒ Base
constructor
A new instance of Base.
Methods included from Authorization
#access_token, #current_user, #fetch_amazon_user_profile, #fetch_user, #fetch_user_from_request, #profile
Constructor Details
#initialize(alexa_payload) ⇒ Base
Returns a new instance of Base.
18 19 20 21 |
# File 'lib/action_alexa/intent/base.rb', line 18 def initialize(alexa_payload) @alexa_payload = alexa_payload @alexa_response = ActionAlexa::Response.new end |
Class Attribute Details
.name ⇒ Object
Returns the value of attribute name.
10 11 12 |
# File 'lib/action_alexa/intent/base.rb', line 10 def name @name end |
Instance Attribute Details
#alexa_payload ⇒ Object (readonly)
Returns the value of attribute alexa_payload.
14 15 16 |
# File 'lib/action_alexa/intent/base.rb', line 14 def alexa_payload @alexa_payload end |
#alexa_response ⇒ Object (readonly)
Returns the value of attribute alexa_response.
14 15 16 |
# File 'lib/action_alexa/intent/base.rb', line 14 def alexa_response @alexa_response end |
Instance Method Details
#execute ⇒ Object
23 24 25 |
# File 'lib/action_alexa/intent/base.rb', line 23 def execute raise 'Implement this method in your intent subclass' end |