saasbook

dip_example_1.rb

Aug 15th, 2013
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.30 KB | None | 0 0
  1. class EmailList
  2.   attr_reader :mailer
  3.   delegate :send_email, :to => :mailer
  4.   def initialize
  5.     @mailer = MailerMonkey.new
  6.   end
  7. end
  8. # in RottenPotatoes EmailListController:
  9. def advertise_discount_for_movie
  10.   moviegoers = Moviegoer.interested_in params[:movie_id]
  11.   EmailList.new.send_email_to moviegoers
  12. end
Add Comment
Please, Sign In to add comment