-
Notifications
You must be signed in to change notification settings - Fork 462
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moves statistics from task router client to individual classes
- Loading branch information
Showing
7 changed files
with
57 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module Twilio | ||
module REST | ||
module TaskRouter | ||
module Statistics | ||
def statistics(args={}) | ||
path = "#{@path}/Statistics" | ||
response = @client.get(path, args, true) | ||
statistic_class = Object.const_get("#{self.class.to_s}Statistics") | ||
statistic_class.new(path, @client, response) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,17 @@ | ||
module Twilio | ||
module REST | ||
module TaskRouter | ||
class TaskQueues < Twilio::REST::NextGenListResource; end | ||
class TaskQueue < InstanceResource; end | ||
class TaskQueues < Twilio::REST::NextGenListResource | ||
def statistics(args={}) | ||
path = "#{@path}/Statistics" | ||
stats = Twilio::REST::TaskRouter::TaskQueuesStatistics.new path, @client | ||
stats.list args, true | ||
end | ||
end | ||
|
||
class TaskQueue < InstanceResource | ||
include Statistics | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
module Twilio | ||
module REST | ||
module TaskRouter | ||
class Workers < Twilio::REST::NextGenListResource; end | ||
class Worker < InstanceResource; end | ||
class Workers < Twilio::REST::NextGenListResource | ||
include Twilio::REST::TaskRouter::Statistics | ||
end | ||
|
||
class Worker < InstanceResource | ||
include Twilio::REST::TaskRouter::Statistics | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters