Module: Moist::Models::Mailing

Included in:
Moist::Mailing
Defined in:
lib/moist/models/mailing.rb

Instance Method Summary collapse

Instance Method Details

#deliver!Object



14
15
16
# File 'lib/moist/models/mailing.rb', line 14

def deliver!
  ::Moist::Delivery.call(self)
end

#deliver?Boolean

Returns:

  • (Boolean)

Raises:



4
5
6
7
8
# File 'lib/moist/models/mailing.rb', line 4

def deliver?
  raise ::Moist::MailingAlreadyDelivered if sent?

  send_at < Time.current
end

#sent?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/moist/models/mailing.rb', line 10

def sent?
  sent_at.present?
end