Class: Users::ListUsers
- Inherits:
-
BaseUseCase
- Object
- BaseUseCase
- Users::ListUsers
- Defined in:
- lib/winewoo_core/use_cases/users/list_users.rb
Instance Method Summary collapse
- #call(filters) {|users ? UseCaseResults.found(users, total) : UseCaseResults.failure| ... } ⇒ Object
-
#initialize(current_user) ⇒ ListUsers
constructor
A new instance of ListUsers.
Constructor Details
#initialize(current_user) ⇒ ListUsers
Returns a new instance of ListUsers.
4 5 6 7 |
# File 'lib/winewoo_core/use_cases/users/list_users.rb', line 4 def initialize(current_user) super(WinewooCore.users_repo.new) self.current_caller = current_user end |
Instance Method Details
#call(filters) {|users ? UseCaseResults.found(users, total) : UseCaseResults.failure| ... } ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/winewoo_core/use_cases/users/list_users.rb', line 10 def call(filters) return unless (&Proc.new) users, total = self.repo.find(filters) yield users ? UseCaseResults.found(users, total) : UseCaseResults.failure end |