Sha256: 1838e4ee85a8887e664e79963173db460227f5640cc16be2f66f6b6a4f4382c0

Contents?: true

Size: 751 Bytes

Versions: 25

Compression:

Stored size: 751 Bytes

Contents

module Twilio
  module REST
    module TaskRouter
      module Statistics
        def statistics(args={})
          path = "#{@path}/Statistics"
          response = @client.get(path, args)
          statistics_class.new(path, @client, response)
        end

        private

        ##
        # Gets the class for the statistics of the current class.
        # Should just be Object.const_get("#{self.class.to_s}Statistics") but
        # Ruby 1.9.3 did not agree. Can be updated if support is dropped.
        def statistics_class
          current_class = self.class.to_s.split('::').last
          statistics_class = Twilio::REST::TaskRouter.const_get(
            "#{current_class}Statistics"
          )
        end
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

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