Class: Twilio::REST::Oauth::V1::OauthInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Oauth::V1::OauthInstance
- Defined in:
- lib/twilio-ruby/rest/oauth/v1/oauth.rb
Instance Method Summary collapse
-
#context ⇒ OauthContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#fetch ⇒ OauthInstance
Fetch the OauthInstance.
-
#initialize(version, payload) ⇒ OauthInstance
constructor
Initialize the OauthInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#keys ⇒ Hash
A collection of certificates where are signed Twilio-issued tokens.
-
#to_s ⇒ Object
Provide a user friendly representation.
- #url ⇒ String
Constructor Details
#initialize(version, payload) ⇒ OauthInstance
Initialize the OauthInstance
122 123 124 125 126 127 128 129 130 131 132 133 134 |
# File 'lib/twilio-ruby/rest/oauth/v1/oauth.rb', line 122 def initialize(version, payload ) super(version) # Marshaled Properties @properties = { 'keys' => payload['keys'], 'url' => payload['url'], } # Context @instance_context = nil @params = { } end |
Instance Method Details
#context ⇒ OauthContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
140 141 142 143 144 145 |
# File 'lib/twilio-ruby/rest/oauth/v1/oauth.rb', line 140 def context unless @instance_context @instance_context = OauthContext.new(@version ) end @instance_context end |
#fetch ⇒ OauthInstance
Fetch the OauthInstance
162 163 164 165 |
# File 'lib/twilio-ruby/rest/oauth/v1/oauth.rb', line 162 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
176 177 178 179 |
# File 'lib/twilio-ruby/rest/oauth/v1/oauth.rb', line 176 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Oauth.V1.OauthInstance #{values}>" end |
#keys ⇒ Hash
Returns A collection of certificates where are signed Twilio-issued tokens.
149 150 151 |
# File 'lib/twilio-ruby/rest/oauth/v1/oauth.rb', line 149 def keys @properties['keys'] end |
#to_s ⇒ Object
Provide a user friendly representation
169 170 171 172 |
# File 'lib/twilio-ruby/rest/oauth/v1/oauth.rb', line 169 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Oauth.V1.OauthInstance #{values}>" end |
#url ⇒ String
155 156 157 |
# File 'lib/twilio-ruby/rest/oauth/v1/oauth.rb', line 155 def url @properties['url'] end |