Class: ActiveSupport::Callbacks::Filters::Around

Inherits:
Object
  • Object
show all
Defined in:
activesupport/lib/active_support/callbacks.rb

Class Method Summary collapse

Class Method Details

.build(callback_sequence, user_callback, user_conditions, chain_config) ⇒ Object


272
273
274
275
276
277
278
279
280
281
282
# File 'activesupport/lib/active_support/callbacks.rb', line 272

def self.build(callback_sequence, user_callback, user_conditions, chain_config)
  if chain_config.key?(:terminator) && user_conditions.any?
    halting_and_conditional(callback_sequence, user_callback, user_conditions)
  elsif chain_config.key? :terminator
    halting(callback_sequence, user_callback)
  elsif user_conditions.any?
    conditional(callback_sequence, user_callback, user_conditions)
  else
    simple(callback_sequence, user_callback)
  end
end