Class: EmailInviter
- Inherits:
-
Object
- Object
- EmailInviter
- Defined in:
- lib/email_inviter.rb
Instance Attribute Summary collapse
-
#emails ⇒ Object
Returns the value of attribute emails.
-
#inviter ⇒ Object
Returns the value of attribute inviter.
-
#locale ⇒ Object
Returns the value of attribute locale.
Instance Method Summary collapse
-
#initialize(emails, inviter, options = {}) ⇒ EmailInviter
constructor
A new instance of EmailInviter.
- #invitation_code ⇒ Object
- #send! ⇒ Object
Constructor Details
#initialize(emails, inviter, options = {}) ⇒ EmailInviter
Returns a new instance of EmailInviter.
6 7 8 9 10 11 |
# File 'lib/email_inviter.rb', line 6 def initialize(emails, inviter, ={}) = .symbolize_keys self.locale = .fetch(:locale, 'en') self.inviter = inviter self.emails = emails end |
Instance Attribute Details
#emails ⇒ Object
Returns the value of attribute emails.
4 5 6 |
# File 'lib/email_inviter.rb', line 4 def emails @emails end |
#inviter ⇒ Object
Returns the value of attribute inviter.
4 5 6 |
# File 'lib/email_inviter.rb', line 4 def inviter @inviter end |
#locale ⇒ Object
Returns the value of attribute locale.
4 5 6 |
# File 'lib/email_inviter.rb', line 4 def locale @locale end |
Instance Method Details
#invitation_code ⇒ Object
19 20 21 |
# File 'lib/email_inviter.rb', line 19 def invitation_code @invitation_code ||= inviter.invitation_code end |
#send! ⇒ Object
23 24 25 |
# File 'lib/email_inviter.rb', line 23 def send! self.emails.each{ |email| mail(email)} end |