Sha256: 7d62c9b4792b18818ba98d3b555d070536e814835e7112595c69df8a63882efb

Contents?: true

Size: 1014 Bytes

Versions: 1

Compression:

Stored size: 1014 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_output_speech_ssml(ssml)
        self.output_speech = OutputSpeech.ssml(ssml)
      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
      
      def set_reprompt_speech_ssml(ssml)
        os = OutputSpeech.ssml(ssml)
        rp = Reprompt.new
        rp.output_speech = os
        self.reprompt = rp
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
alexa_skills_ruby-1.1.0 lib/alexa_skills_ruby/json_objects/response.rb