Class: Luis::Dialog

Inherits:
Base
  • Object
show all
Defined in:
lib/luis/dialog.rb

Overview

Luis dialog class

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Luis::Base

Instance Attribute Details

#context_idObject

Returns the value of attribute context_id.



4
5
6
# File 'lib/luis/dialog.rb', line 4

def context_id
  @context_id
end

#parameter_nameObject

Returns the value of attribute parameter_name.



4
5
6
# File 'lib/luis/dialog.rb', line 4

def parameter_name
  @parameter_name
end

#parameter_typeObject

Returns the value of attribute parameter_type.



4
5
6
# File 'lib/luis/dialog.rb', line 4

def parameter_type
  @parameter_type
end

#promptObject

Returns the value of attribute prompt.



4
5
6
# File 'lib/luis/dialog.rb', line 4

def prompt
  @prompt
end

#statusObject

Returns the value of attribute status.



4
5
6
# File 'lib/luis/dialog.rb', line 4

def status
  @status
end

Instance Method Details

#finished?Boolean

Returns whether the dialog is finished.

Returns:

  • (Boolean)

    whether the dialog is finished



7
8
9
# File 'lib/luis/dialog.rb', line 7

def finished?
  status == 'Finished'
end

#question?Boolean

Returns whether the dialog is question.

Returns:

  • (Boolean)

    whether the dialog is question



12
13
14
# File 'lib/luis/dialog.rb', line 12

def question?
  status == 'Question'
end

#reply(query) ⇒ Object

Reply to dialog

Parameters:

  • reply

    message



18
19
20
# File 'lib/luis/dialog.rb', line 18

def reply(query)
  Luis.query(query, context_id)
end