Class: Twilio::REST::Taskrouter::V1::WorkspaceContext::EventContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, workspace_sid, sid) ⇒ EventContext

Initialize the EventContext

Parameters:

  • version (Version)

    Version that contains the resource

  • workspace_sid (String)

    The SID of the Workspace with the Event to fetch.

  • sid (String)

    The SID of the Event resource to fetch.


264
265
266
267
268
269
270
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 264

def initialize(version, workspace_sid, sid)
  super(version)

  # Path Solution
  @solution = {workspace_sid: workspace_sid, sid: sid, }
  @uri = "/Workspaces/#{@solution[:workspace_sid]}/Events/#{@solution[:sid]}"
end

Instance Method Details

#fetchEventInstance

Fetch the EventInstance

Returns:


275
276
277
278
279
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 275

def fetch
  payload = @version.fetch('GET', @uri)

  EventInstance.new(@version, payload, workspace_sid: @solution[:workspace_sid], sid: @solution[:sid], )
end

#inspectObject

Provide a detailed, user friendly representation


290
291
292
293
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 290

def inspect
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Taskrouter.V1.EventContext #{context}>"
end

#to_sObject

Provide a user friendly representation


283
284
285
286
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 283

def to_s
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Taskrouter.V1.EventContext #{context}>"
end