Sha256: 0201023cbe22b9739c9d10d0ace2464b990324d1c0ec6426642dbeafedf85160

Contents?: true

Size: 870 Bytes

Versions: 54

Compression:

Stored size: 870 Bytes

Contents

module Twilio
  module REST
    class Recordings < ListResource; end

    class Recording < InstanceResource
      def initialize(path, client, params={})
        path.sub! /\/Calls\/CA[^\/]+/, ''
        super path, 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}#{@path}.wav"
      end

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

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

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

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
twilio-ruby-4.13.0 lib/twilio-ruby/rest/recordings.rb
twilio-ruby-4.12.1 lib/twilio-ruby/rest/recordings.rb
twilio-ruby-4.11.1 lib/twilio-ruby/rest/recordings.rb
twilio-ruby-4.11.0 lib/twilio-ruby/rest/recordings.rb
twilio-ruby-4.10.0.edge lib/twilio-ruby/rest/recordings.rb
twilio-ruby-4.10.0 lib/twilio-ruby/rest/recordings.rb
twilio-ruby-4.9.1 lib/twilio-ruby/rest/recordings.rb
twilio-ruby-4.9.1.edge lib/twilio-ruby/rest/recordings.rb
twilio-ruby-4.9.0 lib/twilio-ruby/rest/recordings.rb
twilio-ruby-4.9.0.edge lib/twilio-ruby/rest/recordings.rb
twilio-ruby-4.8.0 lib/twilio-ruby/rest/recordings.rb
twilio-ruby-4.7.0 lib/twilio-ruby/rest/recordings.rb
twilio-ruby-4.8.3.edge lib/twilio-ruby/rest/recordings.rb
twilio-ruby-4.8.2.edge lib/twilio-ruby/rest/recordings.rb
twilio-ruby-4.8.1.edge lib/twilio-ruby/rest/recordings.rb
twilio-ruby-4.8.0.edge lib/twilio-ruby/rest/recordings.rb
twilio-ruby-4.6.2 lib/twilio-ruby/rest/recordings.rb
twilio-ruby-4.6.1 lib/twilio-ruby/rest/recordings.rb
twilio-ruby-4.6.0 lib/twilio-ruby/rest/recordings.rb
twilio-ruby-4.7.0.edge lib/twilio-ruby/rest/recordings.rb