Class: NimbleAuth::Omniauth::Facebook

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(oauth) ⇒ Facebook

Returns a new instance of Facebook.



7
8
9
# File 'app/services/nimble_auth/omniauth/facebook.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/facebook.rb', line 5

def oauth
  @oauth
end

Instance Method Details

#to_hObject



11
12
13
14
15
16
17
18
19
20
# File 'app/services/nimble_auth/omniauth/facebook.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),
    username: raw_info.dig(:username),
    location: raw_info.dig(:location, :name),
    avatar: oauth.dig(:info, :image)
  }
end