class Luis::Result

Luis result class

Attributes

dialog[RW]
entities[RW]
intents[RW]
query[RW]
top_scoring_intent[RW]

Public Instance Methods

awaiting_dialog_response?() click to toggle source

Weather dialog is waiting for a response

# File lib/luis/result.rb, line 36
def awaiting_dialog_response?
  dialog && dialog.question?
end
entities_of_type(type) click to toggle source

Entitities with specific type

# File lib/luis/result.rb, line 31
def entities_of_type(type)
  @entities.select { |entity| entity['type'] == type }.map { |entity| Entity.new entity }
end
reply(query) click to toggle source

Reply to dialog is dialog is waiting for a response

# File lib/luis/result.rb, line 41
def reply(query)
  return false unless awaiting_dialog_response?
  dialog.reply(query)
end