Skip to content

Instantly share code, notes, and snippets.

@danielberkompas
Created July 27, 2012 01:13
Show Gist options
  • Save danielberkompas/3185576 to your computer and use it in GitHub Desktop.
Save danielberkompas/3185576 to your computer and use it in GitHub Desktop.
A sample interactor for Jamon
# 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