Class: NimbleAuth::Omniauth::GoogleOauth2

Inherits:
Object
  • Object
show all
Defined in:
app/services/nimble_auth/omniauth/google_oauth2.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(oauth) ⇒ GoogleOauth2

Returns a new instance of GoogleOauth2.



7
8
9
# File 'app/services/nimble_auth/omniauth/google_oauth2.rb', line 7

def initialize(oauth)
  @oauth = oauth
end

Instance Attribute Details

#oauthObject (readonly)

Returns the value of attribute oauth.



5
6
7
# File 'app/services/nimble_auth/omniauth/google_oauth2.rb', line 5

def oauth
  @oauth
end

Instance Method Details

#to_hObject



11
12
13
14
15
16
17
18
# File 'app/services/nimble_auth/omniauth/google_oauth2.rb', line 11

def to_h
  {
    first_name: raw_info.dig(:first_name),
    last_name: raw_info.dig(:last_name),
    email: raw_info.dig(:email),
    avatar: raw_info.dig(:image)
  }
end