Sha256: 6e6ad4e1c707c0f71d3426f9eb34228988cd0d2e642f0f0d7693410d5af74452

Contents?: true

Size: 829 Bytes

Versions: 3

Compression:

Stored size: 829 Bytes

Contents

# encoding: utf-8

module Adhearsion
  class CallController
    module Output
      class Player < AbstractPlayer

        #
        # @yield The output component before executing it
        # @raise [PlaybackError] if (one of) the given argument(s) could not be played
        #
        def output(content, options = {}, &block)
          options.merge! :ssml => content
          component = new_output options
          if block
            controller.execute_component_and_await_completion component, &block
          else
            controller.execute_component_and_await_completion component
          end
        rescue Call::Hangup
          raise
        rescue Adhearsion::Error, Adhearsion::ProtocolError => e
          raise PlaybackError, "Output failed due to #{e.inspect}"
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
adhearsion-3.0.0.rc1 lib/adhearsion/call_controller/output/player.rb
adhearsion-3.0.0.beta2 lib/adhearsion/call_controller/output/player.rb
adhearsion-3.0.0.beta1 lib/adhearsion/call_controller/output/player.rb