Class: Ralyxa::ResponseEntities::Reprompt
- Inherits:
-
Object
- Object
- Ralyxa::ResponseEntities::Reprompt
- Defined in:
- lib/ralyxa/response_entities/reprompt.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(reprompt_speech, reprompt_ssml) ⇒ Reprompt
constructor
A new instance of Reprompt.
- #to_h ⇒ Object
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_h ⇒ Object
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 |