Skip to content

Instantly share code, notes, and snippets.

@eovolkov
Created July 1, 2015 19:03
Show Gist options
  • Save eovolkov/cf50920293a5db62c530 to your computer and use it in GitHub Desktop.
Save eovolkov/cf50920293a5db62c530 to your computer and use it in GitHub Desktop.
email_notification
def email_notification_params
{
reader: @reader_with_book.name,
book: @reader_with_book.book.title,
author: @reader_with_book.book.author.transliterate,
hours_to_deadline: @reader_with_book.hours_to_deadline(@issue_datetime),
penalty: @reader_with_book.book.price_per_hour
}
end
def email_notification
params = email_notification_params
<<-TEXT
Hello, #{params[:reader]}!
You should return a book #{params[:book]} authored by #{params[:author]} in #{params[:hours_to_deadline]} hours.
Otherwise you will be charged #{params[:penalty]} per hour.
TEXT
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment