Class: Ralyxa::Response
- Inherits:
-
Object
- Object
- Ralyxa::Response
- Defined in:
- lib/ralyxa/response.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(output_speech, session_attributes, end_session, start_over, card) ⇒ Response
constructor
A new instance of Response.
- #to_h ⇒ Object
Constructor Details
#initialize(output_speech, session_attributes, end_session, start_over, card) ⇒ Response
Returns a new instance of Response.
5 6 7 8 9 10 11 |
# File 'lib/ralyxa/response.rb', line 5 def initialize(output_speech, session_attributes, end_session, start_over, card) @output_speech = output_speech @session_attributes = session_attributes @end_session = end_session @start_over = start_over @card = card end |
Class Method Details
.as_hash(output_speech: Ralyxa::OutputSpeech.as_hash, session_attributes: {}, end_session: false, start_over: false, card: false) ⇒ Object
21 22 23 |
# File 'lib/ralyxa/response.rb', line 21 def self.as_hash(output_speech: Ralyxa::OutputSpeech.as_hash, session_attributes: {}, end_session: false, start_over: false, card: false) new(output_speech, session_attributes, end_session, start_over, card).to_h end |
Instance Method Details
#to_h ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/ralyxa/response.rb', line 13 def to_h Hash.new.tap do |response| set_version(response) set_session_attributes(response) set_response(response) end end |