Class: Clova::Skill
- Inherits:
-
Object
- Object
- Clova::Skill
- Defined in:
- lib/clova-speech/skill.rb
Instance Attribute Summary collapse
-
#request ⇒ Object
Returns the value of attribute request.
-
#response ⇒ Object
writeonly
Sets the attribute response.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(request) ⇒ Skill
constructor
A new instance of Skill.
Constructor Details
#initialize(request) ⇒ Skill
Returns a new instance of Skill.
4 5 6 7 |
# File 'lib/clova-speech/skill.rb', line 4 def initialize(request) @request = request @response = response end |
Instance Attribute Details
#request ⇒ Object
Returns the value of attribute request.
3 4 5 |
# File 'lib/clova-speech/skill.rb', line 3 def request @request end |
#response=(value) ⇒ Object
Sets the attribute response
3 4 5 |
# File 'lib/clova-speech/skill.rb', line 3 def response=(value) @response = value end |
Instance Method Details
#call ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/clova-speech/skill.rb', line 9 def call case request.type when 'LaunchRequest' then launch_request when 'IntentRequest' then intent_request when 'EventRequest' then event_request when 'SessionEndedRequest' then session_ended_request end @response.as_json.to_json end |