Skip to content

Instantly share code, notes, and snippets.

@joaquimadraz
Created March 30, 2015 23:41
Show Gist options
  • Save joaquimadraz/54ac6850a5578b4b41db to your computer and use it in GitHub Desktop.
Save joaquimadraz/54ac6850a5578b4b41db to your computer and use it in GitHub Desktop.
simple_use_case_example
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