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:



25
26
27
28
29
# File 'lib/carrierwave/uploader/callbacks.rb', line 25

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

#_before_callbacks_for(kind) ⇒ Object

:nodoc:



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

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

#after(kind, callback) ⇒ Object



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

def after(kind, callback)
  _after_callbacks_for(kind) << callback
end

#before(kind, callback) ⇒ Object



31
32
33
# File 'lib/carrierwave/uploader/callbacks.rb', line 31

def before(kind, callback)
  _before_callbacks_for(kind) << callback
end