Class: Twilio::REST::Verify::V2::ServiceContext::AccessTokenContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Verify::V2::ServiceContext::AccessTokenContext
- Defined in:
- lib/twilio-ruby/rest/verify/v2/service/access_token.rb
Instance Method Summary collapse
-
#fetch ⇒ AccessTokenInstance
Fetch the AccessTokenInstance.
-
#initialize(version, service_sid, sid) ⇒ AccessTokenContext
constructor
Initialize the AccessTokenContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, service_sid, sid) ⇒ AccessTokenContext
Initialize the AccessTokenContext
87 88 89 90 91 92 93 94 95 |
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 87 def initialize(version, service_sid, sid) super(version) # Path Solution @solution = { service_sid: service_sid, sid: sid, } @uri = "/Services/#{@solution[:service_sid]}/AccessTokens/#{@solution[:sid]}" end |
Instance Method Details
#fetch ⇒ AccessTokenInstance
Fetch the AccessTokenInstance
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 99 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) AccessTokenInstance.new( @version, payload, service_sid: @solution[:service_sid], sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
126 127 128 129 |
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 126 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Verify.V2.AccessTokenContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
119 120 121 122 |
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 119 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Verify.V2.AccessTokenContext #{context}>" end |