Class: OauthService
- Inherits:
 - 
      Object
      
        
- Object
 - OauthService
 
 
- Defined in:
 - app/services/oauth_service.rb
 
Overview
Handles OAuth connection and user management.
Instance Attribute Summary collapse
- 
  
    
      #auth  ⇒ Hash 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
stores information retrieved after oauth call.
 - 
  
    
      #user_id  ⇒ Integer 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
stores user id of verifying user.
 
Instance Method Summary collapse
- 
  
    
      #connect_user  ⇒ Method 
    
    
  
  
  
  
  
  
  
  
  
    
This method allows for connection and login with same service.
 - 
  
    
      #initialize(auth, user_id = nil)  ⇒ OauthService 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
This method initializes oauth object.
 
Constructor Details
#initialize(auth, user_id = nil) ⇒ OauthService
This method initializes oauth object
      10 11 12 13  | 
    
      # File 'app/services/oauth_service.rb', line 10 def initialize(auth, user_id = nil) @auth = auth @user_id = user_id end  | 
  
Instance Attribute Details
#auth ⇒ Hash
stores information retrieved after oauth call
      5 6 7  | 
    
      # File 'app/services/oauth_service.rb', line 5 def auth @auth end  | 
  
#user_id ⇒ Integer
stores user id of verifying user
      5 6 7  | 
    
      # File 'app/services/oauth_service.rb', line 5 def user_id @user_id end  | 
  
Instance Method Details
#connect_user ⇒ Method
This method allows for connection and login with same service.
      19 20 21  | 
    
      # File 'app/services/oauth_service.rb', line 19 def connect_user @user_id.present? ? existing_user : new_user end  |