lib/passaporte_web/identity.rb in passaporteweb-client-0.3.0 vs lib/passaporte_web/identity.rb in passaporteweb-client-0.4.0

- old
+ new

@@ -70,9 +70,23 @@ response = Http.get("/accounts/api/identities/#{uuid}/profile") attributes_hash = MultiJson.decode(response.body) load_identity(attributes_hash) end + # Finds an Profile by it's email (primary or secondary) using the ***DEPRECATED*** profile endpoint. Returns + # the Identity instance, with the primary email used by the Identity. + # Raises a <tt>RestClient::ResourceNotFound</tt> exception if no + # Identity exists with the supplied email. + # + # API method: <tt>GET /profile/api/info/?email=:email</tt> + # + # API documentation: http://myfreecomm.github.io/passaporte-web/pweb/api/perfil.html#get-profile-api-info-email-email + def self.profile_by_email(email) + response = Http.get("/profile/api/info/", email: email) + attributes_hash = MultiJson.decode(response.body) + load_identity(attributes_hash) + end + # Checks if an Identity exists on PassaporteWeb and if the password is correct. Returns an instance of # Identity for the supplied email if the password is correct (although with only basic attributes set). # Returns <tt>false</tt> if the password is wrong or if no Identity exists on PassaporteWeb with # the supplied email. Use it to validate that a user is who he says he is. #