Module: Basket::Batcher

Defined in:
lib/basket/batcher.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



3
4
5
# File 'lib/basket/batcher.rb', line 3

def self.included(base)
  base.extend(ClassMethods)
end

Instance Method Details

#batchObject



20
21
22
# File 'lib/basket/batcher.rb', line 20

def batch
  @batch ||= Basket.queue_collection.read(self.class.name)
end

#on_addObject



31
32
# File 'lib/basket/batcher.rb', line 31

def on_add
end

#on_failureObject



34
35
36
# File 'lib/basket/batcher.rb', line 34

def on_failure
  raise error
end

#on_successObject



28
29
# File 'lib/basket/batcher.rb', line 28

def on_success
end

#performObject

Raises:



24
25
26
# File 'lib/basket/batcher.rb', line 24

def perform
  raise Basket::Error, "You must implement perform in your Basket class."
end