Class: Ralyxa::ResponseEntities::Reprompt

Inherits:
Object
  • Object
show all
Defined in:
lib/ralyxa/response_entities/reprompt.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(reprompt_speech, reprompt_ssml) ⇒ Reprompt

Returns a new instance of Reprompt.



4
5
6
7
# File 'lib/ralyxa/response_entities/reprompt.rb', line 4

def initialize(reprompt_speech, reprompt_ssml)
  @reprompt_speech = reprompt_speech
  @reprompt_ssml   = reprompt_ssml
end

Class Method Details

.as_hash(reprompt_speech: nil, reprompt_ssml: false) ⇒ Object



15
16
17
# File 'lib/ralyxa/response_entities/reprompt.rb', line 15

def self.as_hash(reprompt_speech: nil, reprompt_ssml: false)
  new(reprompt_speech, reprompt_ssml).to_h
end

Instance Method Details

#to_hObject



9
10
11
12
13
# File 'lib/ralyxa/response_entities/reprompt.rb', line 9

def to_h
  {}.tap do |reprompt|
    reprompt[:outputSpeech] = Ralyxa::ResponseEntities::OutputSpeech.as_hash(speech: @reprompt_speech, ssml: @reprompt_ssml)
  end
end