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
70 71 72 73 74 75 76 77 78 |
# File 'lib/twilio-ruby/rest/verify/v2/safelist.rb', line 70 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
82 83 84 85 86 87 |
# File 'lib/twilio-ruby/rest/verify/v2/safelist.rb', line 82 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
92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/twilio-ruby/rest/verify/v2/safelist.rb', line 92 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
114 115 116 117 |
# File 'lib/twilio-ruby/rest/verify/v2/safelist.rb', line 114 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Verify.V2.SafelistContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
107 108 109 110 |
# File 'lib/twilio-ruby/rest/verify/v2/safelist.rb', line 107 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Verify.V2.SafelistContext #{context}>" end |