-
-
Save robins35/beeeb0a2aba97389d7e5 to your computer and use it in GitHub Desktop.
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
def initialize options={} | |
options ||= {} | |
self.bcc = options[:bcc] || "" | |
self.body = options[:body] | |
self.cc = options[:cc] || "" | |
self.link_to_timeline = options[:link_to_timeline] || true | |
self.listing = options[:listing] | |
self.listing_id = options[:listing_id] | |
self.message = options[:message] | |
self.recipient = options[:recipient] | |
self.recipient_id = options[:recipient_id] | |
self.sender = options[:sender] | |
self.sender_id = options[:sender_id] | |
self.subject = options[:subject] | |
self.listing ||= Listing.find_by_id listing_id | |
self.recipient ||= Person.find_by_id recipient_id | |
self.sender ||= Person.find_by_id sender_id | |
self.send_me_a_copy = if options[:send_me_a_copy].present? | |
checked?(options[:send_me_a_copy]) | |
else | |
true | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment