Class: Twilio::REST::Taskrouter::V1::WorkspaceContext::EventContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Taskrouter::V1::WorkspaceContext::EventContext
- Defined in:
- lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb
Instance Method Summary collapse
-
#fetch ⇒ EventInstance
Fetch the EventInstance.
-
#initialize(version, workspace_sid, sid) ⇒ EventContext
constructor
Initialize the EventContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, workspace_sid, sid) ⇒ EventContext
Initialize the EventContext
205 206 207 208 209 210 211 212 213 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 205 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
#fetch ⇒ EventInstance
Fetch the EventInstance
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 217 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) EventInstance.new( @version, payload, workspace_sid: @solution[:workspace_sid], sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
244 245 246 247 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 244 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Taskrouter.V1.EventContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
237 238 239 240 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb', line 237 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Taskrouter.V1.EventContext #{context}>" end |