Class: AlexaSkillsRuby::JsonObjects::Response

Inherits:
AlexaSkillsRuby::JsonObject show all
Defined in:
lib/alexa_skills_ruby/json_objects/response.rb

Instance Method Summary collapse

Methods inherited from AlexaSkillsRuby::JsonObject

#as_json, attribute, inherited, json_object_attribute, #populate_from_json, #serialize_attributes, #to_json

Constructor Details

#initializeResponse

Returns a new instance of Response.



9
10
11
# File 'lib/alexa_skills_ruby/json_objects/response.rb', line 9

def initialize
  self.should_end_session = true
end

Instance Method Details

#set_output_speech_ssml(ssml) ⇒ Object



17
18
19
# File 'lib/alexa_skills_ruby/json_objects/response.rb', line 17

def set_output_speech_ssml(ssml)
  self.output_speech = OutputSpeech.ssml(ssml)
end

#set_output_speech_text(text) ⇒ Object



13
14
15
# File 'lib/alexa_skills_ruby/json_objects/response.rb', line 13

def set_output_speech_text(text)
self.output_speech = OutputSpeech.text(text)
end

#set_reprompt_speech_ssml(ssml) ⇒ Object



32
33
34
35
36
37
# File 'lib/alexa_skills_ruby/json_objects/response.rb', line 32

def set_reprompt_speech_ssml(ssml)
  os = OutputSpeech.ssml(ssml)
  rp = Reprompt.new
  rp.output_speech = os
  self.reprompt = rp
end

#set_reprompt_speech_text(text) ⇒ Object



25
26
27
28
29
30
# File 'lib/alexa_skills_ruby/json_objects/response.rb', line 25

def set_reprompt_speech_text(text)
os = OutputSpeech.text(text)
rp = Reprompt.new
rp.output_speech = os
self.reprompt = rp
end

#set_simple_card(title, content) ⇒ Object



21
22
23
# File 'lib/alexa_skills_ruby/json_objects/response.rb', line 21

def set_simple_card(title, content)
  self.card = Card.simple(title, content)
end