Class: GoogleAppsOauth2::Transport
- Inherits:
-
Object
- Object
- GoogleAppsOauth2::Transport
- Includes:
- HTTParty
- Defined in:
- lib/google_apps_oauth2/transport.rb
Instance Method Summary collapse
- #get_users(options = {}) ⇒ Object
-
#initialize(options, &block) ⇒ Transport
constructor
A new instance of Transport.
Constructor Details
#initialize(options, &block) ⇒ Transport
Returns a new instance of Transport.
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/google_apps_oauth2/transport.rb', line 14 def initialize(, &block) @domain = [:domain] @token = [:token] @client_id = [:client_id] @client_secret = [:client_secret] @refresh_token = [:refresh_token] @token_changed_block = block @user_path= "/#{@domain}/user/2.0" end |
Instance Method Details
#get_users(options = {}) ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/google_apps_oauth2/transport.rb', line 25 def get_users( = {}) headers = {'content-type' => 'application/atom+xml', 'Authorization' => "OAuth #{token}"} url = user_path + "?startUsername=#{[:start]}" response = self.class.get(url, headers: headers) response = check_for_refresh(response) response end |