Sha256: a573737a39be68ba26879e928159c2b56d3177d852d6662b7220c51df40e2336

Contents?: true

Size: 863 Bytes

Versions: 8

Compression:

Stored size: 863 Bytes

Contents

module Twilio
  module REST
    class Recordings < ListResource; end

    class Recording < InstanceResource
      def initialize(uri, client, params={})
        uri.sub! /\/Calls\/CA[^\/]+/, ''
        super uri, client, params
        resource :transcriptions
        # grab a reference to the client's connection object for streaming
        @connection = @client.instance_variable_get :@connection
      end

      ##
      # Return the wav URL for this recording.
      def wav
        "https://#{@connection.address}#{@uri}.wav"
      end

      def wav!(&block)
        @connection.request_get @uri, &block
      end

      ##
      # Return the mp3 URL for this recording.
      def mp3
        "https://#{@connection.address}#{@uri}.mp3"
      end

      def mp3!(&block)
        @connection.request_get "#{@uri}.mp3", &block
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
twilio-ruby-3.9.0 lib/twilio-ruby/rest/recordings.rb
twilio-ruby-3.8.0 lib/twilio-ruby/rest/recordings.rb
twilio-ruby-3.7.1 lib/twilio-ruby/rest/recordings.rb
twilio-ruby-3.7.0 lib/twilio-ruby/rest/recordings.rb
twilio-ruby-3.6.0 lib/twilio-ruby/rest/recordings.rb
twilio-ruby-3.5.1 lib/twilio-ruby/rest/recordings.rb
twilio-ruby-3.5.0 lib/twilio-ruby/rest/recordings.rb
twilio-ruby-3.4.2 lib/twilio-ruby/rest/recordings.rb