File: //usr/local/rvm/gems/ruby-2.7.4/doc/mail-2.7.1/ri/Mail/Message/delivery_handler-i.ri
U:RDoc::Attr[iI"delivery_handler:ETI"#Mail::Message#delivery_handler;TI"RW;T:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"KIf you assign a delivery handler, mail will call :deliver_mail on the ;TI"Gobject you assign to delivery_handler, it will pass itself as the ;TI"single argument.;To:RDoc::Markup::BlankLine o;
; [I"HIf you define a delivery_handler, then you are responsible for the ;TI"-following actions in the delivery cycle:;T@o:RDoc::Markup::List:
@type:BULLET:@items[ o:RDoc::Markup::ListItem:@label0; [o;
; [I"AAppending the mail object to Mail.deliveries as you see fit.;To;;0; [o;
; [I"GChecking the mail.perform_deliveries flag to decide if you should ;TI"4actually call :deliver! the mail object or not.;To;;0; [o;
; [I"CChecking the mail.raise_delivery_errors flag to decide if you ;TI"0should raise delivery errors if they occur.;To;;0; [o;
; [I"FActually calling :deliver! (with the bang) on the mail object to ;TI"get it to deliver itself.;T@o;
; [I"=A simplest implementation of a delivery_handler would be;T@o:RDoc::Markup::Verbatim; [I"class MyObject
;TI"
;TI" def initialize
;TI"9 @mail = Mail.new('To: mikel@test.lindsaar.net')
;TI"' @mail.delivery_handler = self
;TI" end
;TI"
;TI" attr_accessor :mail
;TI"
;TI" def deliver_mail(mail)
;TI" yield
;TI" end
;TI" end
;T:@format0o;
; [I"Then doing:;T@o;; [I"obj = MyObject.new
;TI"obj.mail.deliver
;T;0o;
; [I"NWould cause Mail to call obj.deliver_mail passing itself as a parameter, ;TI"Kwhich then can just yield and let Mail do its own private do_delivery ;TI"method.;T:
@fileI"lib/mail/message.rb;T:0@omit_headings_from_table_of_contents_below0F@MI"Mail::Message;TcRDoc::NormalClass0