Class: WinewooUser::Favorites::GetFavorites
- Inherits:
-
BaseUseCase
- Object
- BaseUseCase
- WinewooUser::Favorites::GetFavorites
- Defined in:
- lib/winewoo_core/use_cases/winewoo_user/favorites/get_favorites.rb
Instance Method Summary collapse
- #call(winewoo_user, filters) {|favorites ? UseCaseResults.found(favorites) : UseCaseResults.failure| ... } ⇒ Object
-
#initialize(log_params = nil) ⇒ GetFavorites
constructor
A new instance of GetFavorites.
Constructor Details
#initialize(log_params = nil) ⇒ GetFavorites
Returns a new instance of GetFavorites.
4 5 6 |
# File 'lib/winewoo_core/use_cases/winewoo_user/favorites/get_favorites.rb', line 4 def initialize(log_params=nil) super(WinewooCore.favorites_repo.new, log_params) end |
Instance Method Details
#call(winewoo_user, filters) {|favorites ? UseCaseResults.found(favorites) : UseCaseResults.failure| ... } ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/winewoo_core/use_cases/winewoo_user/favorites/get_favorites.rb', line 9 def call(winewoo_user, filters) favorites = self.repo.find(winewoo_user, filters) yield favorites ? UseCaseResults.found(favorites) : UseCaseResults.failure end |