Class: ActionAlexa::Intent::Base

Inherits:
Object
  • Object
show all
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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

.nameObject

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_payloadObject (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_responseObject (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

#executeObject



23
24
25
# File 'lib/action_alexa/intent/base.rb', line 23

def execute
  raise 'Implement this method in your intent subclass'
end