Class: KynetxAmApi::Oauth
- Inherits:
-
Object
- Object
- KynetxAmApi::Oauth
- Defined in:
- lib/kynetx_am_api/oauth.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#account_consumer ⇒ Object
Returns the value of attribute account_consumer.
-
#api_consumer ⇒ Object
Returns the value of attribute api_consumer.
-
#request_token ⇒ Object
Returns the value of attribute request_token.
-
#user ⇒ Object
Returns the value of attribute user.
Class Method Summary collapse
- .accounts_server_url=(v) ⇒ Object
- .api_server_url=(v) ⇒ Object
- .consumer_key=(v) ⇒ Object
- .consumer_secret=(v) ⇒ Object
Instance Method Summary collapse
- #get_access_token ⇒ Object
- #get_request_token ⇒ Object
-
#initialize(user = nil) ⇒ Oauth
constructor
A new instance of Oauth.
Constructor Details
#initialize(user = nil) ⇒ Oauth
Returns a new instance of Oauth.
14 15 16 17 18 19 |
# File 'lib/kynetx_am_api/oauth.rb', line 14 def initialize(user=nil) @user = KynetxAmApi::User.new(user) if @user.oauth_verifier access_tokens end end |
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
11 12 13 |
# File 'lib/kynetx_am_api/oauth.rb', line 11 def access_token @access_token end |
#account_consumer ⇒ Object
Returns the value of attribute account_consumer.
8 9 10 |
# File 'lib/kynetx_am_api/oauth.rb', line 8 def account_consumer @account_consumer end |
#api_consumer ⇒ Object
Returns the value of attribute api_consumer.
9 10 11 |
# File 'lib/kynetx_am_api/oauth.rb', line 9 def api_consumer @api_consumer end |
#request_token ⇒ Object
Returns the value of attribute request_token.
7 8 9 |
# File 'lib/kynetx_am_api/oauth.rb', line 7 def request_token @request_token end |
#user ⇒ Object
Returns the value of attribute user.
10 11 12 |
# File 'lib/kynetx_am_api/oauth.rb', line 10 def user @user end |
Class Method Details
.accounts_server_url=(v) ⇒ Object
32 33 34 |
# File 'lib/kynetx_am_api/oauth.rb', line 32 def self.accounts_server_url=(v) @@accounts_server_url = v end |
.api_server_url=(v) ⇒ Object
36 37 38 |
# File 'lib/kynetx_am_api/oauth.rb', line 36 def self.api_server_url=(v) @@api_server_url = v end |
.consumer_key=(v) ⇒ Object
40 41 42 |
# File 'lib/kynetx_am_api/oauth.rb', line 40 def self.consumer_key=(v) @@consumer_key = v end |
.consumer_secret=(v) ⇒ Object
44 45 46 |
# File 'lib/kynetx_am_api/oauth.rb', line 44 def self.consumer_secret=(v) @@consumer_secret = v end |
Instance Method Details
#get_access_token ⇒ Object
21 22 23 24 |
# File 'lib/kynetx_am_api/oauth.rb', line 21 def get_access_token return @access_token if @access_token return @access_token = OAuth::AccessToken.new(get_api_consumer, @user.access_token, @user.access_secret) end |
#get_request_token ⇒ Object
26 27 28 29 |
# File 'lib/kynetx_am_api/oauth.rb', line 26 def get_request_token return @request_token if @request_token return @request_token = get_account_consumer.get_request_token end |