Class: Rivendell::Import::Notifiers

Inherits:
Object
  • Object
show all
Defined in:
lib/rivendell/import/notifiers.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeNotifiers

Returns a new instance of Notifiers.



6
7
8
# File 'lib/rivendell/import/notifiers.rb', line 6

def initialize
  @import = import
end

Instance Attribute Details

#importObject (readonly)

Returns the value of attribute import.



4
5
6
# File 'lib/rivendell/import/notifiers.rb', line 4

def import
  @import
end

#notifiersObject (readonly)

Returns the value of attribute notifiers.



4
5
6
# File 'lib/rivendell/import/notifiers.rb', line 4

def notifiers
  @notifiers
end

Instance Method Details

#notify!Object



14
15
16
17
18
19
20
21
# File 'lib/rivendell/import/notifiers.rb', line 14

def notify!
  notified_tasks = waiting_tasks
  @waiting_tasks = []

  notifiers.each do |notifier|
    notifier.notify notified_tasks
  end
end

#push(notifier) ⇒ Object



10
11
12
# File 'lib/rivendell/import/notifiers.rb', line 10

def push(notifier)
  notifiers << notifier
end