Skip to content

Instantly share code, notes, and snippets.

@iheanyi
Forked from BlakeWilliams/recipe_creator.rb
Created April 28, 2015 01:25
Show Gist options
  • Save iheanyi/bdb7b27f8d5a5ebae8b7 to your computer and use it in GitHub Desktop.
Save iheanyi/bdb7b27f8d5a5ebae8b7 to your computer and use it in GitHub Desktop.
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