Class: Twilio::REST::Monitor::V1::AlertContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Monitor::V1::AlertContext
- Defined in:
- lib/twilio-ruby/rest/monitor/v1/alert.rb
Instance Method Summary collapse
-
#delete ⇒ Boolean
Deletes the AlertInstance.
-
#fetch ⇒ AlertInstance
Fetch a AlertInstance.
-
#initialize(version, sid) ⇒ AlertContext
constructor
Initialize the AlertContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, sid) ⇒ AlertContext
Initialize the AlertContext
200 201 202 203 204 205 206 |
# File 'lib/twilio-ruby/rest/monitor/v1/alert.rb', line 200 def initialize(version, sid) super(version) # Path Solution @solution = {sid: sid, } @uri = "/Alerts/#{@solution[:sid]}" end |
Instance Method Details
#delete ⇒ Boolean
Deletes the AlertInstance
226 227 228 |
# File 'lib/twilio-ruby/rest/monitor/v1/alert.rb', line 226 def delete @version.delete('delete', @uri) end |
#fetch ⇒ AlertInstance
Fetch a AlertInstance
211 212 213 214 215 216 217 218 219 220 221 |
# File 'lib/twilio-ruby/rest/monitor/v1/alert.rb', line 211 def fetch params = Twilio::Values.of({}) payload = @version.fetch( 'GET', @uri, params, ) AlertInstance.new(@version, payload, sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
239 240 241 242 |
# File 'lib/twilio-ruby/rest/monitor/v1/alert.rb', line 239 def inspect context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Monitor.V1.AlertContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
232 233 234 235 |
# File 'lib/twilio-ruby/rest/monitor/v1/alert.rb', line 232 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Monitor.V1.AlertContext #{context}>" end |