Class: Twilio::REST::Taskrouter::V1::WorkspaceContext::WorkerContext::WorkersRealTimeStatisticsContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Taskrouter::V1::WorkspaceContext::WorkerContext::WorkersRealTimeStatisticsContext
- Defined in:
- lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.rb
Instance Method Summary collapse
-
#fetch(task_channel: :unset) ⇒ WorkersRealTimeStatisticsInstance
Fetch the WorkersRealTimeStatisticsInstance.
-
#initialize(version, workspace_sid) ⇒ WorkersRealTimeStatisticsContext
constructor
Initialize the WorkersRealTimeStatisticsContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, workspace_sid) ⇒ WorkersRealTimeStatisticsContext
Initialize the WorkersRealTimeStatisticsContext
52 53 54 55 56 57 58 59 60 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.rb', line 52 def initialize(version, workspace_sid) super(version) # Path Solution @solution = { workspace_sid: workspace_sid, } @uri = "/Workspaces/#{@solution[:workspace_sid]}/Workers/RealTimeStatistics" end |
Instance Method Details
#fetch(task_channel: :unset) ⇒ WorkersRealTimeStatisticsInstance
Fetch the WorkersRealTimeStatisticsInstance
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.rb', line 65 def fetch( task_channel: :unset ) params = Twilio::Values.of({ 'TaskChannel' => task_channel, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, params: params, headers: headers) WorkersRealTimeStatisticsInstance.new( @version, payload, workspace_sid: @solution[:workspace_sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
96 97 98 99 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.rb', line 96 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Taskrouter.V1.WorkersRealTimeStatisticsContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
89 90 91 92 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.rb', line 89 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Taskrouter.V1.WorkersRealTimeStatisticsContext #{context}>" end |