Class: Aws::Lex::Conversation::Slot::Elicitor

Inherits:
Object
  • Object
show all
Defined in:
lib/aws/lex/conversation/slot/elicitor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Elicitor

Returns a new instance of Elicitor.



10
11
12
13
14
15
16
# File 'lib/aws/lex/conversation/slot/elicitor.rb', line 10

def initialize(opts = {})
  self.conversation = opts.fetch(:conversation)
  self.elicitations = opts.fetch(:elicitations) { [] }
  elicitations.each do |elicitation|
    elicitation.conversation = conversation
  end
end

Instance Attribute Details

#conversationObject

Returns the value of attribute conversation.



8
9
10
# File 'lib/aws/lex/conversation/slot/elicitor.rb', line 8

def conversation
  @conversation
end

#elicitationsObject

Returns the value of attribute elicitations.



8
9
10
# File 'lib/aws/lex/conversation/slot/elicitor.rb', line 8

def elicitations
  @elicitations
end

Instance Method Details

#elicit!Object



22
23
24
# File 'lib/aws/lex/conversation/slot/elicitor.rb', line 22

def elicit!
  incomplete_elicitations.first.elicit! if elicit?
end

#elicit?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/aws/lex/conversation/slot/elicitor.rb', line 18

def elicit?
  incomplete_elicitations.any?
end