Class: NoBrainer::Document::TableConfig::Synchronizer

Inherits:
Object
  • Object
show all
Defined in:
lib/no_brainer/document/table_config/synchronizer.rb

Instance Method Summary collapse

Constructor Details

#initialize(models) ⇒ Synchronizer

Returns a new instance of Synchronizer.



2
3
4
# File 'lib/no_brainer/document/table_config/synchronizer.rb', line 2

def initialize(models)
  @models = models
end

Instance Method Details

#sync_table_config(options = {}) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/no_brainer/document/table_config/synchronizer.rb', line 6

def sync_table_config(options={})
  @models.each(&:sync_table_config)

  unless options[:wait] == false
    # Waiting on all models due to possible races
    @models.each(&:table_wait)
  end

  true
end