Class: Kublog::Network::Email::SingleEmail

Inherits:
Object
  • Object
show all
Defined in:
lib/kublog/network/email.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(notification, user) ⇒ SingleEmail

Returns a new instance of SingleEmail.



92
93
94
95
96
97
98
99
# File 'lib/kublog/network/email.rb', line 92

def initialize(notification, user)
  @subject = notification.title
  @notification = notification
  @body = notification.content
  @post = notification.post
  @url =  notification.url
  @user = user
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



90
91
92
# File 'lib/kublog/network/email.rb', line 90

def body
  @body
end

#postObject

Returns the value of attribute post.



90
91
92
# File 'lib/kublog/network/email.rb', line 90

def post
  @post
end

#subjectObject

Returns the value of attribute subject.



90
91
92
# File 'lib/kublog/network/email.rb', line 90

def subject
  @subject
end

#urlObject

Returns the value of attribute url.



90
91
92
# File 'lib/kublog/network/email.rb', line 90

def url
  @url
end

Instance Method Details

#performObject

Sends a single e-mail to the user



102
103
104
105
# File 'lib/kublog/network/email.rb', line 102

def perform
  PostMailer.new_post(self, @post, @user).deliver
  @notification.delivered
end