Sha256: 0e4272ceb9c1f87358f96f8298cc60402aba382effd650ea000f0238a8b6da9c

Contents?: true

Size: 723 Bytes

Versions: 4

Compression:

Stored size: 723 Bytes

Contents

module AlexaSkillsRuby
  module JsonObjects
    class Response < JsonObject
      attributes :should_end_session
      json_object_attribute :output_speech, OutputSpeech
      json_object_attribute :card, Card
      json_object_attribute :reprompt, Reprompt

      def initialize
        self.should_end_session = true
      end

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

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

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
alexa_skills_ruby-1.0.0 lib/alexa_skills_ruby/json_objects/response.rb
alexa_skills_ruby-0.0.7 lib/alexa_skills_ruby/json_objects/response.rb
alexa_skills_ruby-0.0.6 lib/alexa_skills_ruby/json_objects/response.rb
alexa_skills_ruby-0.0.5 lib/alexa_skills_ruby/json_objects/response.rb