-
-
Save iheanyi/bdb7b27f8d5a5ebae8b7 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
class RecipeCreator | |
attr_reader :recipe | |
def initialize(params) | |
@recipe = Recipe.new(params) | |
end | |
def save | |
saved = recipes.save | |
if saved | |
trigger_webhook | |
send_email | |
end | |
saved | |
end | |
private | |
def trigger_webhook | |
# Logic goes here | |
end | |
def send_email | |
# Logic goes here | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment