Class: Parse::User
Instance Attribute Summary
Attributes inherited from Object
#class_name, #created_at, #parse_object_id, #updated_at
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data = nil) ⇒ User
constructor
A new instance of User.
- #uri ⇒ Object
Methods inherited from Object
#as_json, #decrement, #increment, #new?, #parse_delete, #pointer, #refresh, #safe_json, #save, #to_json
Constructor Details
#initialize(data = nil) ⇒ User
Returns a new instance of User.
25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/parse/user.rb', line 25 def initialize(data = nil) @class_name = Parse::Protocol::CLASS_USER #stringify symbol keys data["username"] = data[:username] if data[:username] data["password"] = data[:password] if data[:password] if data parse data end self end |
Class Method Details
.authenticate(username, password) ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/parse/user.rb', line 9 def self.authenticate(username, password) body = { "username" => username, "password" => password } response = Parse.client.request(Parse::Protocol::USER_LOGIN_URI, :get, nil, body) new(response) end |