Class: Newsly::Newsletter

Inherits:
LiquidModel
  • Object
show all
Defined in:
app/models/newsly/newsletter.rb

Instance Method Summary collapse

Methods inherited from LiquidModel

#after_validation, #body=, #render

Instance Method Details

#draft?Boolean

return true if never sent or batch_sent

Returns:

  • (Boolean)


14
15
16
# File 'app/models/newsly/newsletter.rb', line 14

def draft?
  self.sent? || self.batch_sent? ? false : true
end

#statusObject

Returns the status a string. TODO, make nicer!



21
22
23
24
25
# File 'app/models/newsly/newsletter.rb', line 21

def status
  return "draft" if self.draft?
  return "sent" if self.sent?
  return "batch" if self.batch_sent?
end