Module: CarrierWave::Uploader::Callbacks::ClassMethods

Defined in:
lib/carrierwave/uploader/callbacks.rb

Instance Method Summary collapse

Instance Method Details

#_after_callbacks_for(kind) ⇒ Object

:nodoc:



24
25
26
# File 'lib/carrierwave/uploader/callbacks.rb', line 24

def _after_callbacks_for(kind) #:nodoc:
  (self._after_callbacks || { kind => [] })[kind] || []
end

#_before_callbacks_for(kind) ⇒ Object

:nodoc:



20
21
22
# File 'lib/carrierwave/uploader/callbacks.rb', line 20

def _before_callbacks_for(kind) #:nodoc:
  (self._before_callbacks || { kind => [] })[kind] || []
end

#after(kind, callback) ⇒ Object



33
34
35
36
# File 'lib/carrierwave/uploader/callbacks.rb', line 33

def after(kind, callback)
  self._after_callbacks ||= {}
  self._after_callbacks[kind] = _after_callbacks_for(kind) + [callback]
end

#before(kind, callback) ⇒ Object



28
29
30
31
# File 'lib/carrierwave/uploader/callbacks.rb', line 28

def before(kind, callback)          
  self._before_callbacks ||= {}
  self._before_callbacks[kind] = _before_callbacks_for(kind) + [callback]
end