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.



172
173
174
175
176
177
178
179
180
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 172

def initialize(version, sid)
    super(version)

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

    
end

Instance Method Details

#fetchEventInstance

Fetch the EventInstance

Returns:



184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 184

def fetch

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.fetch('GET', @uri, headers: headers)
    EventInstance.new(
        @version,
        payload,
        sid: @solution[:sid],
    )
end

#inspectObject

Provide a detailed, user friendly representation



210
211
212
213
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 210

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

#to_sObject

Provide a user friendly representation



203
204
205
206
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 203

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