Skip to content

Instantly share code, notes, and snippets.

@tobias
Forked from charliedavi/gist:2001582
Created March 8, 2012 15:54
Show Gist options
  • Select an option

  • Save tobias/2001637 to your computer and use it in GitHub Desktop.

Select an option

Save tobias/2001637 to your computer and use it in GitHub Desktop.
class PostCodeGo
include TorqueBox::Messaging::Backgroundable
always_background :postcode, :priority => :normal
def postcode(time, origin, mode, email)
iso = Real::Chrone.new_or_cached(time: time, origin: origin, mode: mode.to_sym)
csvs = [iso.postcode_csv, iso.postcode_sector_csv, iso.postcode_district_csv]
CsvMailer.files(csvs, time, mode, email).deliver
end
class << self
def postcode(time, origin, mode, email)
PostCodeGo.new.postcode(time, origin, mode, email)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment