Class: AlexaToolbox::Intent
- Inherits:
-
Object
- Object
- AlexaToolbox::Intent
- Defined in:
- lib/alexa_toolbox/intent.rb
Overview
Handles the intent object in requests.
Instance Attribute Summary collapse
-
#confirmation_status ⇒ Object
readonly
Returns the value of attribute confirmation_status.
-
#json ⇒ Object
readonly
Returns the value of attribute json.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #has_slots? ⇒ Boolean
-
#initialize(intent) ⇒ Intent
constructor
A new instance of Intent.
- #slots ⇒ Object
Constructor Details
#initialize(intent) ⇒ Intent
Returns a new instance of Intent.
6 7 8 9 10 11 |
# File 'lib/alexa_toolbox/intent.rb', line 6 def initialize (intent) raise ArgumentError, 'Invalid Intent' if intent[:name].empty? @name = intent[:name] @confirmation_status = intent[:confirmationStatus] @json = intent end |
Instance Attribute Details
#confirmation_status ⇒ Object (readonly)
Returns the value of attribute confirmation_status.
4 5 6 |
# File 'lib/alexa_toolbox/intent.rb', line 4 def confirmation_status @confirmation_status end |
#json ⇒ Object (readonly)
Returns the value of attribute json.
4 5 6 |
# File 'lib/alexa_toolbox/intent.rb', line 4 def json @json end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/alexa_toolbox/intent.rb', line 4 def name @name end |
Instance Method Details
#has_slots? ⇒ Boolean
13 14 15 |
# File 'lib/alexa_toolbox/intent.rb', line 13 def has_slots? return self.slots != {} end |
#slots ⇒ Object
17 18 19 |
# File 'lib/alexa_toolbox/intent.rb', line 17 def slots return self.json[:slots] end |