Method: Net::Facebook::Models::User.find_by

Defined in:
lib/net/facebook/models/user.rb

.find_by(params = {}) ⇒ Net::Facebook::Models::User

Returns the existing Facebook user matching the provided attributes or nil when the user is not found.

@ return [nil] when the user cannot be found.

Parameters:

  • params (Hash) (defaults to: {})

    the attributes to find a user by.

Options Hash (params):

  • :username (String)

    The Facebook user’s username (case-insensitive).

  • :access_token (String)

    The Facebook user’s access_token (case-insensitive).

Returns:



35
36
37
38
39
# File 'lib/net/facebook/models/user.rb', line 35

def self.find_by(params = {})
  find_by! params
rescue Errors::UnknownUser
  nil
end