Class: Expando::Updater

Inherits:
Object
  • Object
show all
Defined in:
lib/expando/updater.rb

Direct Known Subclasses

EntityUpdater, IntentUpdater

Constant Summary collapse

DEFAULT_INTENTS_PATH =

The default location of intent source files

File.join( Dir.pwd, 'intents')
DEFAULT_ENTITIES_PATH =

The default location of entity source files

File.join( Dir.pwd, 'entities' )

Instance Method Summary collapse

Constructor Details

#initialize(name = nil, intents_path: DEFAULT_INTENTS_PATH, entities_path: DEFAULT_ENTITIES_PATH, client_keys: {}) ⇒ Updater

Initialize a new ‘Updater`.

Parameters:

  • name (Symbol) (defaults to: nil)

    The name of the intent or entity to update. (default: ‘nil`)

  • entities_path (String) (defaults to: DEFAULT_ENTITIES_PATH)

    The path to the directory containing the entities text files. (default: ‘’entities’‘)

  • intents_path (String) (defaults to: DEFAULT_INTENTS_PATH)

    The path to the directory containing the intents source files. (default: ‘intents’)

  • client_keys (Hash) (defaults to: {})

    A hash of Api.ai credentials.

Options Hash (client_keys:):

  • :developer_access_token (String)

    The Api.ai developer access token.

  • :client_access_token (String)

    The Api.ai client access token.



22
23
24
25
26
27
28
# File 'lib/expando/updater.rb', line 22

def initialize( name = nil, intents_path: DEFAULT_INTENTS_PATH, entities_path: DEFAULT_ENTITIES_PATH, client_keys: {})
  @name = name
  @intents_path = intents_path
  @entities_path = entities_path

  @client = ApiAiRuby::Client.new( credentials( client_keys ) )
end