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.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The url.
Constructor Details
#initialize(version, payload) ⇒ OauthInstance
Initialize the OauthInstance
104 105 106 107 108 109 110 111 112 113 |
# File 'lib/twilio-ruby/rest/oauth/v1/oauth.rb', line 104 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
119 120 121 122 123 124 |
# File 'lib/twilio-ruby/rest/oauth/v1/oauth.rb', line 119 def context unless @instance_context @instance_context = OauthContext.new(@version, ) end @instance_context end |
#fetch ⇒ OauthInstance
Fetch the OauthInstance
141 142 143 |
# File 'lib/twilio-ruby/rest/oauth/v1/oauth.rb', line 141 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
154 155 156 157 |
# File 'lib/twilio-ruby/rest/oauth/v1/oauth.rb', line 154 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Oauth.V1.OauthInstance #{values}>" end |
#keys ⇒ Hash
Returns A collection of certificates.
128 129 130 |
# File 'lib/twilio-ruby/rest/oauth/v1/oauth.rb', line 128 def keys @properties['keys'] end |
#to_s ⇒ Object
Provide a user friendly representation
147 148 149 150 |
# File 'lib/twilio-ruby/rest/oauth/v1/oauth.rb', line 147 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Oauth.V1.OauthInstance #{values}>" end |
#url ⇒ String
Returns The url.
134 135 136 |
# File 'lib/twilio-ruby/rest/oauth/v1/oauth.rb', line 134 def url @properties['url'] end |