Class: EasyMail::Namespace
- Inherits:
-
Object
- Object
- EasyMail::Namespace
- Extended by:
- ActiveModel::Naming
- Includes:
- ActiveModel::Conversion
- Defined in:
- lib/easy_mail/namespace.rb
Instance Attribute Summary collapse
-
#bcc ⇒ Object
Returns the value of attribute bcc.
-
#from ⇒ Object
Returns the value of attribute from.
-
#name ⇒ Object
Returns the value of attribute name.
-
#subject ⇒ Object
Returns the value of attribute subject.
-
#to ⇒ Object
Returns the value of attribute to.
Instance Method Summary collapse
-
#initialize(mailer, name, attributes = {}) ⇒ Namespace
constructor
A new instance of Namespace.
Constructor Details
#initialize(mailer, name, attributes = {}) ⇒ Namespace
Returns a new instance of Namespace.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/easy_mail/namespace.rb', line 8 def initialize(mailer, name, attributes = {}) @name = (mailer.namespaces.map(&:name) + [name.to_s]).join("/") if mailer.namespaces.any? @to = attributes[:to] || mailer.namespaces[-1].to @bcc = attributes[:bcc] || mailer.namespaces[-1].bcc @from = attributes[:from] || mailer.namespaces[-1].from @subject = attributes[:subject] || mailer.namespaces[-1].subject else @to = attributes[:to] || mailer.default_to @bcc= attributes[:bcc] || mailer.default_bcc @from = attributes[:from] || mailer.default_from @subject = attributes[:subject] || mailer.default_subject end end |
Instance Attribute Details
#bcc ⇒ Object
Returns the value of attribute bcc.
6 7 8 |
# File 'lib/easy_mail/namespace.rb', line 6 def bcc @bcc end |
#from ⇒ Object
Returns the value of attribute from.
6 7 8 |
# File 'lib/easy_mail/namespace.rb', line 6 def from @from end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/easy_mail/namespace.rb', line 6 def name @name end |
#subject ⇒ Object
Returns the value of attribute subject.
6 7 8 |
# File 'lib/easy_mail/namespace.rb', line 6 def subject @subject end |
#to ⇒ Object
Returns the value of attribute to.
6 7 8 |
# File 'lib/easy_mail/namespace.rb', line 6 def to @to end |