Module: AlexaRuby

Defined in:
lib/alexa_ruby.rb,
lib/alexa_ruby/alexa.rb,
lib/alexa_ruby/version.rb,
lib/alexa_ruby/response/card.rb,
lib/alexa_ruby/response/response.rb,
lib/alexa_ruby/request/base_request.rb,
lib/alexa_ruby/response/audio_player.rb,
lib/alexa_ruby/request/intent_request.rb,
lib/alexa_ruby/request/launch_request.rb,
lib/alexa_ruby/request/base_request/user.rb,
lib/alexa_ruby/request/intent_request/slot.rb,
lib/alexa_ruby/request/audio_player_request.rb,
lib/alexa_ruby/request/base_request/context.rb,
lib/alexa_ruby/request/base_request/session.rb,
lib/alexa_ruby/request/session_ended_request.rb,
lib/alexa_ruby/request/base_request/validator.rb,
lib/alexa_ruby/request/base_request/validator/uri.rb,
lib/alexa_ruby/request/base_request/context/device.rb,
lib/alexa_ruby/request/base_request/context/audio_state.rb,
lib/alexa_ruby/request/base_request/validator/certificates.rb

Overview

Session end request class.

Defined Under Namespace

Classes: Alexa, AudioPlayer, AudioPlayerRequest, AudioState, BaseRequest, Card, Certificates, Context, Device, IntentRequest, LaunchRequest, Response, Session, SessionEndedRequest, Slot, URI, User, Validator

Constant Summary collapse

VERSION =
'1.5.0'.freeze

Class Method Summary collapse

Class Method Details

.new(request, opts = {}) ⇒ Object

Validate HTTP/S request body and initialize new Alexa Assistant

Parameters:

  • request (Object)

    request from Amazon Alexa web service, can be hash or JSON encoded string

  • opts (Hash) (defaults to: {})

    additional options: :disable_validations [Boolean] disables request validation if true :certificates_chain_url [String] URL of Amazon SSL certificates chain :request_signature [String] Base64-encoded request signature

Returns:

  • (Object)

    new Request object instance

Raises:

  • (ArgumentError)

    if given object isn't a valid JSON object


40
41
42
43
# File 'lib/alexa_ruby.rb', line 40

def new(request, opts = {})
  obj = build_json(request)
  Alexa.new(obj, opts)
end