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.6.0.edge lib/twilio-ruby/rest/task_router/statistics.rb
twilio-ruby-4.5.0 lib/twilio-ruby/rest/task_router/statistics.rb
twilio-ruby-4.4.0 lib/twilio-ruby/rest/task_router/statistics.rb
twilio-ruby-4.3.0 lib/twilio-ruby/rest/task_router/statistics.rb
twilio-ruby-4.2.1 lib/twilio-ruby/rest/task_router/statistics.rb