Sha256: 7a10da1a334c8c06efe4dd99bc1242ce867a933104cade965662aa86009842f6
Contents?: true
Size: 930 Bytes
Versions: 1
Compression:
Stored size: 930 Bytes
Contents
# -*- encoding : utf-8 -*- require 'parse/protocol' require 'parse/client' require 'parse/error' require 'parse/object' module Parse class User < Parse::Object def self.authenticate(username, password) body = { "username" => username, "password" => password } response = Parse.client.request(Parse::Protocol::USER_LOGIN_URI, :get, nil, body) Parse.client.session_token = response[Parse::Protocol::KEY_USER_SESSION_TOKEN] new(response) end def self.reset_password(email) body = {"email" => email} Parse.client.post(Parse::Protocol::PASSWORD_RESET_URI, body.to_json) end def initialize(data = nil) data["username"] = data[:username] if data[:username] data["password"] = data[:password] if data[:password] super(Parse::Protocol::CLASS_USER, data) end def uri Protocol.user_uri @parse_object_id end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
parse-ruby-client-0.3.0 | lib/parse/user.rb |