Class: MailInterceptor::Interceptor
- Inherits:
-
Object
- Object
- MailInterceptor::Interceptor
- Defined in:
- lib/mail_interceptor.rb
Instance Attribute Summary collapse
-
#deliver_emails_to ⇒ Object
Returns the value of attribute deliver_emails_to.
-
#env ⇒ Object
Returns the value of attribute env.
-
#forward_emails_to ⇒ Object
Returns the value of attribute forward_emails_to.
-
#ignore_bcc ⇒ Object
Returns the value of attribute ignore_bcc.
-
#ignore_cc ⇒ Object
Returns the value of attribute ignore_cc.
Instance Method Summary collapse
- #delivering_email(message) ⇒ Object
-
#initialize(options = {}) ⇒ Interceptor
constructor
A new instance of Interceptor.
Constructor Details
#initialize(options = {}) ⇒ Interceptor
Returns a new instance of Interceptor.
9 10 11 12 13 14 15 16 17 |
# File 'lib/mail_interceptor.rb', line 9 def initialize = {} @deliver_emails_to = Array.wrap [:deliver_emails_to] @forward_emails_to = .fetch :forward_emails_to @ignore_cc = .fetch :ignore_cc, true @ignore_bcc = .fetch :ignore_bcc, true @env = .fetch :env, InterceptorEnv.new sanitize_forward_emails_to end |
Instance Attribute Details
#deliver_emails_to ⇒ Object
Returns the value of attribute deliver_emails_to.
7 8 9 |
# File 'lib/mail_interceptor.rb', line 7 def deliver_emails_to @deliver_emails_to end |
#env ⇒ Object
Returns the value of attribute env.
7 8 9 |
# File 'lib/mail_interceptor.rb', line 7 def env @env end |
#forward_emails_to ⇒ Object
Returns the value of attribute forward_emails_to.
7 8 9 |
# File 'lib/mail_interceptor.rb', line 7 def forward_emails_to @forward_emails_to end |
#ignore_bcc ⇒ Object
Returns the value of attribute ignore_bcc.
7 8 9 |
# File 'lib/mail_interceptor.rb', line 7 def ignore_bcc @ignore_bcc end |
#ignore_cc ⇒ Object
Returns the value of attribute ignore_cc.
7 8 9 |
# File 'lib/mail_interceptor.rb', line 7 def ignore_cc @ignore_cc end |
Instance Method Details
#delivering_email(message) ⇒ Object
19 20 21 22 23 |
# File 'lib/mail_interceptor.rb', line 19 def delivering_email .to = normalize_recipients(.to).flatten.uniq .cc = [] if ignore_cc .bcc = [] if ignore_bcc end |