Class: Twilio::REST::Monitor::V1::EventContext

Inherits:
InstanceContext show all
Defined in:
lib/twilio-ruby/rest/monitor/v1/event.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, sid) ⇒ EventContext

Initialize the EventContext

Parameters:

  • version (Version)

    Version that contains the resource

  • sid (String)

    The SID of the Event resource to fetch.


216
217
218
219
220
221
222
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 216

def initialize(version, sid)
  super(version)

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

Instance Method Details

#fetchEventInstance

Fetch the EventInstance

Returns:


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

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

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

#inspectObject

Provide a detailed, user friendly representation


242
243
244
245
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 242

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

#to_sObject

Provide a user friendly representation


235
236
237
238
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 235

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