Class: Clova::IntentRequest
- Defined in:
- lib/clova-speech/request/intent_request.rb
Instance Attribute Summary collapse
-
#intent ⇒ Object
Returns the value of attribute intent.
-
#name ⇒ Object
Returns the value of attribute name.
-
#slots ⇒ Object
Returns the value of attribute slots.
-
#type ⇒ Object
Returns the value of attribute type.
Attributes inherited from Request
Instance Method Summary collapse
- #find_slot_value_by(slot_name) ⇒ Object
-
#initialize(session:, context:, request:, version:) ⇒ IntentRequest
constructor
A new instance of IntentRequest.
Methods inherited from Request
Constructor Details
#initialize(session:, context:, request:, version:) ⇒ IntentRequest
Returns a new instance of IntentRequest.
4 5 6 7 8 9 10 11 |
# File 'lib/clova-speech/request/intent_request.rb', line 4 def initialize(session:, context:, request:, version:) super @intent = request[:intent] @name = @intent[:name] @slots = @intent[:slots] @type = 'IntentRequest' end |
Instance Attribute Details
#intent ⇒ Object
Returns the value of attribute intent.
3 4 5 |
# File 'lib/clova-speech/request/intent_request.rb', line 3 def intent @intent end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/clova-speech/request/intent_request.rb', line 3 def name @name end |
#slots ⇒ Object
Returns the value of attribute slots.
3 4 5 |
# File 'lib/clova-speech/request/intent_request.rb', line 3 def slots @slots end |
#type ⇒ Object
Returns the value of attribute type.
3 4 5 |
# File 'lib/clova-speech/request/intent_request.rb', line 3 def type @type end |
Instance Method Details
#find_slot_value_by(slot_name) ⇒ Object
13 14 15 16 17 |
# File 'lib/clova-speech/request/intent_request.rb', line 13 def find_slot_value_by(slot_name) name = slot_name name = name.to_sym if name.is_a?(String) @slots[name][:value] end |