Sha256: 199185d0b5b76a732453a0d8c72786c260a33ef57aed8b308916fb525dd32698

Contents?: true

Size: 829 Bytes

Versions: 9

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, Punchblock::ProtocolError => e
          raise PlaybackError, "Output failed due to #{e.inspect}"
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
adhearsion-2.6.4 lib/adhearsion/call_controller/output/player.rb
adhearsion-2.6.3 lib/adhearsion/call_controller/output/player.rb
adhearsion-2.6.2 lib/adhearsion/call_controller/output/player.rb
adhearsion-2.6.1 lib/adhearsion/call_controller/output/player.rb
adhearsion-2.6.0 lib/adhearsion/call_controller/output/player.rb
adhearsion-2.5.4 lib/adhearsion/call_controller/output/player.rb
adhearsion-2.5.3 lib/adhearsion/call_controller/output/player.rb
adhearsion-2.5.2 lib/adhearsion/call_controller/output/player.rb
adhearsion-2.5.0 lib/adhearsion/call_controller/output/player.rb