Module: Stilts::Hooks

Defined in:
lib/stilts/rails/hooks.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



4
5
6
7
# File 'lib/stilts/rails/hooks.rb', line 4

def self.included(base)
  base.before_filter :image_batch
  base.append_before_filter :deliver_batch
end

Instance Method Details

#deliver_batchObject



12
13
14
# File 'lib/stilts/rails/hooks.rb', line 12

def deliver_batch
  @image_batch.deliver unless @image_batch.empty?
end

#image_batchObject



9
10
11
# File 'lib/stilts/rails/hooks.rb', line 9

def image_batch
  @image_batch = Stilts::Batch.new
end