-
-
Save havenwood/2da302c63b6359e2b359f475219f46c0 to your computer and use it in GitHub Desktop.
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 Worker | |
ROLES = %w[admin manager].freeze | |
def perform | |
@role = ROLES.sample | |
select_based_on_role | |
end | |
def select_based_on_role | |
puts case @role | |
when "admin" | |
"i'm an admin" | |
when "manager" | |
"i'm a manager" | |
end | |
end | |
end | |
class BreadWorker | |
include Worker | |
end | |
| |
class CakeWorker | |
include Worker | |
end | |
BreadWorker.new.perform |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment