Class: Pendaxes::Notificator

Inherits:
Object
  • Object
show all
Extended by:
Defaults, Finder
Includes:
PendingManager
Defined in:
lib/pendaxes/notificator.rb,
lib/pendaxes/notificators/file.rb,
lib/pendaxes/notificators/mail.rb,
lib/pendaxes/notificators/terminal.rb,
lib/pendaxes/notificators/growth_forecast.rb

Direct Known Subclasses

File, GrowthForecast, Mail, Terminal

Defined Under Namespace

Classes: File, GrowthForecast, Mail, Terminal

Instance Method Summary collapse

Methods included from Defaults

defaults

Methods included from Finder

announce, find, inherited

Methods included from PendingManager

#add, #all_pendings, #pendings, #reset

Constructor Details

#initialize(config = {}) ⇒ Notificator

Returns a new instance of Notificator.



14
15
16
17
# File 'lib/pendaxes/notificator.rb', line 14

def initialize(config={})
  @config = Hashr.new(self.class.defaults.merge(config))
  @pendings = []
end

Instance Method Details

#notifyObject



19
20
# File 'lib/pendaxes/notificator.rb', line 19

def notify
end

#report_for(pendings) ⇒ Object



26
27
28
29
30
# File 'lib/pendaxes/notificator.rb', line 26

def report_for(pendings)
  r = reporter.new({include_allowed: true}.merge(@config.reporter))
  r.add pendings
  r.report
end

#reporterObject



22
23
24
# File 'lib/pendaxes/notificator.rb', line 22

def reporter
  Reporter.find(@config.reporter.use.to_sym)
end