From 3e2711909a5b801ef3f5785175b7be45d0bacc7e Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Fri, 11 Nov 2016 11:17:53 +0100 Subject: [PATCH] Added inline doc. --- lib/notification_factory/template.rb | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/lib/notification_factory/template.rb b/lib/notification_factory/template.rb index 13e740186..b10a9ecac 100644 --- a/lib/notification_factory/template.rb +++ b/lib/notification_factory/template.rb @@ -1,5 +1,28 @@ class NotificationFactory::Template +=begin + +examples how to use + + message_subject = NotificationFactory::Template.new( + { + ticket: Ticket.first, + }, + 'de-de', + 'some template <%= d "ticket.title", false %> <%= c "fqdn", false %>', + false + ).render + + message_body = NotificationFactory::Template.new( + { + ticket: Ticket.first, + }, + 'de-de', + 'some template <%= d "ticket.title", true %> <%= c "fqdn", true %>', + ).render + +=end + def initialize(objects, locale, template, escape = true) @objects = objects @locale = locale || 'en-us'