Class: User
- Inherits:
-
Flareshow::Base
- Object
- Flareshow::Base
- User
- Defined in:
- lib/user.rb
Class Method Summary collapse
-
.current ⇒ Object
return the current authenticated user.
-
.log_in(login, password) ⇒ Object
authenticate user credentials.
Instance Method Summary collapse
- #comments ⇒ Object
- #files ⇒ Object
-
#flows ⇒ Object
= Associations = ================.
- #logged_in? ⇒ Boolean
-
#logout ⇒ Object
= Authentication = ==================.
- #posts ⇒ Object
Methods inherited from Flareshow::Base
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
Constructor Details
This class inherits a constructor from Flareshow::Base
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
#comments ⇒ Object
55 56 57 |
# File 'lib/user.rb', line 55 def comments Comment.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
Associations =
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
Authentication =
66 67 68 |
# File 'lib/user.rb', line 66 def logout end |