Created
March 30, 2015 23:41
-
-
Save joaquimadraz/54ac6850a5578b4b41db to your computer and use it in GitHub Desktop.
simple_use_case_example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module App | |
module UseCases | |
module Users | |
module AssignBadge | |
# REQUIRED CONTEXT: | |
# - id | |
# - badge_id | |
class Base < UseCase::Base | |
depends ParseParams, | |
FindUser, | |
FindBadge, | |
Assign | |
def perform | |
logger.info "Badge '#{context.badge.name}' was assigned to #{user.id}" | |
end | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment