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
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
74 75 76 77 78 79 80 81 82 |
# File 'lib/twilio-ruby/rest/verify/v2/safelist.rb', line 74 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
86 87 88 89 90 91 92 93 |
# File 'lib/twilio-ruby/rest/verify/v2/safelist.rb', line 86 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#fetch ⇒ SafelistInstance
Fetch the SafelistInstance
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/twilio-ruby/rest/verify/v2/safelist.rb', line 98 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) SafelistInstance.new( @version, payload, phone_number: @solution[:phone_number], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
124 125 126 127 |
# File 'lib/twilio-ruby/rest/verify/v2/safelist.rb', line 124 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Verify.V2.SafelistContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
117 118 119 120 |
# File 'lib/twilio-ruby/rest/verify/v2/safelist.rb', line 117 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Verify.V2.SafelistContext #{context}>" end |