Class: Ralyxa::ResponseBuilder
- Inherits:
-
Object
- Object
- Ralyxa::ResponseBuilder
- Defined in:
- lib/ralyxa/response_builder.rb
Class Method Summary collapse
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(response_class, output_speech_class, reprompt_class, options) ⇒ ResponseBuilder
constructor
A new instance of ResponseBuilder.
Constructor Details
#initialize(response_class, output_speech_class, reprompt_class, options) ⇒ ResponseBuilder
Returns a new instance of ResponseBuilder.
6 7 8 9 10 11 |
# File 'lib/ralyxa/response_builder.rb', line 6 def initialize(response_class, output_speech_class, reprompt_class, ) @response_class = response_class @output_speech_class = output_speech_class @reprompt_class = reprompt_class @options = end |
Class Method Details
.build(options = {}, response_class = Ralyxa::ResponseEntities::Response, output_speech_class = Ralyxa::ResponseEntities::OutputSpeech, reprompt_class = Ralyxa::ResponseEntities::Reprompt) ⇒ Object
13 14 15 |
# File 'lib/ralyxa/response_builder.rb', line 13 def self.build( = {}, response_class = Ralyxa::ResponseEntities::Response, output_speech_class = Ralyxa::ResponseEntities::OutputSpeech, reprompt_class = Ralyxa::ResponseEntities::Reprompt) new(response_class, output_speech_class, reprompt_class, ).build end |
Instance Method Details
#build ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/ralyxa/response_builder.rb', line 17 def build merge_output_speech if response_text_exists? merge_reprompt if reprompt_exists? merge_card if card_exists? @response_class.as_hash(@options).to_json end |