Class: Twilio::REST::Verify::V2::SafelistContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Verify::V2::SafelistContext
- Defined in:
- lib/twilio-ruby/rest/verify/v2/safelist.rb
Overview
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the SafelistInstance.
-
#fetch ⇒ SafelistInstance
Fetch the SafelistInstance.
-
#initialize(version, phone_number) ⇒ SafelistContext
constructor
Initialize the SafelistContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, phone_number) ⇒ SafelistContext
Initialize the SafelistContext
69 70 71 72 73 74 75 76 77 |
# File 'lib/twilio-ruby/rest/verify/v2/safelist.rb', line 69 def initialize(version, phone_number) super(version) # Path Solution @solution = { phone_number: phone_number, } @uri = "/SafeList/Numbers/#{@solution[:phone_number]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the SafelistInstance
81 82 83 84 |
# File 'lib/twilio-ruby/rest/verify/v2/safelist.rb', line 81 def delete @version.delete('DELETE', @uri) end |
#fetch ⇒ SafelistInstance
Fetch the SafelistInstance
89 90 91 92 93 94 95 96 97 |
# File 'lib/twilio-ruby/rest/verify/v2/safelist.rb', line 89 def fetch payload = @version.fetch('GET', @uri) SafelistInstance.new( @version, payload, phone_number: @solution[:phone_number], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
109 110 111 112 |
# File 'lib/twilio-ruby/rest/verify/v2/safelist.rb', line 109 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Verify.V2.SafelistContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
102 103 104 105 |
# File 'lib/twilio-ruby/rest/verify/v2/safelist.rb', line 102 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Verify.V2.SafelistContext #{context}>" end |