Class: User
Class Method Summary
collapse
Instance Method Summary
collapse
all, api_endpoint, assimilate_resources, auth_endpoint, authenticate, #changes, commit, create, #destroy, #destroyed?, dispatch, find, first, get, #get, handle_response, http_get, #id, #initialize, list, #method_missing, #method_name, post, process_response, query, #refresh, #save, server_defined?, #set, store, #update
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Flareshow::Base
Class Method Details
.current ⇒ Object
return the current authenticated user
9
10
11
|
# File 'lib/user.rb', line 9
def current
@current
end
|
.log_in(login, password) ⇒ Object
authenticate user credentials
14
15
16
17
18
19
20
21
|
# File 'lib/user.rb', line 14
def log_in(login, password)
authenticate({:login => login, :password => password},
{
:on_success => method(:on_authentication_success),
:on_failure => method(:on_authentication_failure)
}
)
end
|
Instance Method Details
55
56
57
|
# File 'lib/user.rb', line 55
def
.find({"user_id" => {"in" => id}})
end
|
#files ⇒ Object
59
60
61
|
# File 'lib/user.rb', line 59
def files
FileAttachment.find({"user_id" => {"in" => id}})
end
|
#flows ⇒ Object
47
48
49
|
# File 'lib/user.rb', line 47
def flows
Flow.find({"user_id" => {"in" => id}})
end
|
#logged_in? ⇒ Boolean
70
71
72
|
# File 'lib/user.rb', line 70
def logged_in?
auth_token
end
|
#logout ⇒ Object
66
67
68
|
# File 'lib/user.rb', line 66
def logout
end
|
#posts ⇒ Object
51
52
53
|
# File 'lib/user.rb', line 51
def posts
Post.find({"user_id" => {"in" => id}})
end
|