Module: Whatser::OAuth
- Included in:
- Client
- Defined in:
- lib/whatser/net/oauth.rb
Instance Method Summary collapse
- #get_oauth_token(code, params = {}) ⇒ Object
- #login(email, password) ⇒ Object
- #oauth_authorize_url(params = {}) ⇒ Object
- #oauth_client ⇒ Object
Instance Method Details
#get_oauth_token(code, params = {}) ⇒ Object
9 10 11 |
# File 'lib/whatser/net/oauth.rb', line 9 def get_oauth_token(code, params={}) oauth_client.web_server.get_access_token( code, params) end |
#login(email, password) ⇒ Object
17 18 19 |
# File 'lib/whatser/net/oauth.rb', line 17 def login(email, password) request( :get, '/oauth/access_token', {:query => password_grant_params(email, password)}, :auth => :key, :keys => auth_keys ) end |
#oauth_authorize_url(params = {}) ⇒ Object
13 14 15 |
# File 'lib/whatser/net/oauth.rb', line 13 def (params={}) oauth_client.web_server.(params) end |
#oauth_client ⇒ Object
5 6 7 |
# File 'lib/whatser/net/oauth.rb', line 5 def oauth_client OAuth2::Client.new(api_key, api_secret, :site => api_uri) end |