Module: Clockwork::Methods

Included in:
Clockwork
Defined in:
lib/clockwork.rb,
lib/clockwork/database_events.rb

Instance Method Summary collapse

Instance Method Details

#clear!Object


49
50
51
# File 'lib/clockwork.rb', line 49

def clear!
  Clockwork.manager = Manager.new
end

#configure(&block) ⇒ Object


25
26
27
# File 'lib/clockwork.rb', line 25

def configure(&block)
  Clockwork.manager.configure(&block)
end

#error_handler(&block) ⇒ Object


33
34
35
# File 'lib/clockwork.rb', line 33

def error_handler(&block)
  Clockwork.manager.error_handler(&block)
end

#every(period, job, options = {}, &block) ⇒ Object


41
42
43
# File 'lib/clockwork.rb', line 41

def every(period, job, options={}, &block)
  Clockwork.manager.every(period, job, options, &block)
end

#handler(&block) ⇒ Object


29
30
31
# File 'lib/clockwork.rb', line 29

def handler(&block)
  Clockwork.manager.handler(&block)
end

#on(event, options = {}, &block) ⇒ Object


37
38
39
# File 'lib/clockwork.rb', line 37

def on(event, options={}, &block)
  Clockwork.manager.on(event, options, &block)
end

#runObject


45
46
47
# File 'lib/clockwork.rb', line 45

def run
  Clockwork.manager.run
end

#sync_database_events(options = {}, &block) ⇒ Object


17
18
19
# File 'lib/clockwork/database_events.rb', line 17

def sync_database_events(options={}, &block)
  DatabaseEvents::SyncPerformer.setup(options, &block)
end