Created
July 27, 2012 01:13
-
-
Save danielberkompas/3185576 to your computer and use it in GitHub Desktop.
A sample interactor for Jamon
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
# app/interactors/admin/automated_tasks.rb | |
class Admin::AutomatedTasks | |
def self.run | |
Oem.all.each do |oem| | |
Admin::SendOemDataDump.run(oem) | |
end | |
end | |
end | |
# app/interactors/admin/send_oem_data_dump.rb | |
class Admin::SendOemDataDump | |
attr_accessor :oem, :data | |
def self.run(oem) | |
Admin::SendOemDataDump.new(oem).run | |
end | |
def initialize(oem) | |
@oem = oem | |
end | |
def run | |
# 1. figure out data to send based on @oem and | |
# set to @data var | |
# 2. call send_email | |
end | |
private | |
def send_email | |
# send the email to intended recipient, | |
# based on @oem and @data | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment