Class: Expando::IntentUpdater

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

Instance Method Summary collapse

Constructor Details

#initializeIntentUpdater

Initialize a new ‘IntentUpdater`.

See Also:



18
19
20
# File 'lib/expando/intent_updater.rb', line 18

def initialize( * )
  super
end

Instance Attribute Details

#intents_pathObject

!@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

#nameObject

!@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