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.



201
202
203
204
205
206
207
208
209
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 201

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:



213
214
215
216
217
218
219
220
221
222
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 213

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



234
235
236
237
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 234

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

#to_sObject

Provide a user friendly representation



227
228
229
230
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 227

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