Class: Expando::IntentUpdater
- Defined in:
- lib/expando/intent_updater.rb
Overview
Responsible for updating intent objects on Api.ai based on the contents of files in ‘/intents`.
Constant Summary
Constants inherited from Updater
Updater::DEFAULT_ENTITIES_PATH, Updater::DEFAULT_INTENTS_PATH
Instance Attribute Summary collapse
-
#intents_path ⇒ Object
!@attribute intents_path @return [String] the path to the directory containing the intent source files.
-
#name ⇒ Object
!@attribute name @return [String] the name of the intent to be updated.
Instance Method Summary collapse
-
#initialize ⇒ IntentUpdater
constructor
Initialize a new ‘IntentUpdater`.
-
#update! ⇒ Hash, ApiAiRuby::RequestError
Update the named entity on Api.ai.
Constructor Details
#initialize ⇒ IntentUpdater
Initialize a new ‘IntentUpdater`.
18 19 20 |
# File 'lib/expando/intent_updater.rb', line 18 def initialize( * ) super end |
Instance Attribute Details
#intents_path ⇒ Object
!@attribute intents_path
@return [String] the path to the directory containing the intent source files
13 14 15 |
# File 'lib/expando/intent_updater.rb', line 13 def intents_path @intents_path end |
#name ⇒ Object
!@attribute name
@return [String] the name of the intent to be updated
9 10 11 |
# File 'lib/expando/intent_updater.rb', line 9 def name @name end |
Instance Method Details
#update! ⇒ Hash, ApiAiRuby::RequestError
Update the named entity on Api.ai.
26 27 28 29 30 |
# File 'lib/expando/intent_updater.rb', line 26 def update! response = @client.update_intent_request( intent_json ) handle_response( response, :intent ) end |