123456789_123456789_123456789_123456789_123456789_

Class: ActiveSupport::Callbacks::Filters::After

Do not use. This class is for internal use only.
Relationships & Source Files
Inherits: Object
Defined in: activesupport/lib/active_support/callbacks.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(user_callback, user_conditions, chain_config) ⇒ After

[ GitHub ]

  
# File 'activesupport/lib/active_support/callbacks.rb', line 195

def initialize(user_callback, user_conditions, chain_config)
  halting = chain_config[:skip_after_callbacks_if_terminated]
  @user_callback, @user_conditions, @halting = user_callback, user_conditions, halting
  freeze
end

Instance Attribute Details

#halting (readonly)

[ GitHub ]

  
# File 'activesupport/lib/active_support/callbacks.rb', line 194

attr_reader :user_callback, :user_conditions, :halting

#user_callback (readonly)

[ GitHub ]

  
# File 'activesupport/lib/active_support/callbacks.rb', line 194

attr_reader :user_callback, :user_conditions, :halting

#user_conditions (readonly)

[ GitHub ]

  
# File 'activesupport/lib/active_support/callbacks.rb', line 194

attr_reader :user_callback, :user_conditions, :halting

Instance Method Details

#apply(callback_sequence)

[ GitHub ]

  
# File 'activesupport/lib/active_support/callbacks.rb', line 213

def apply(callback_sequence)
  callback_sequence.after(self)
end

#call(env)

[ GitHub ]

  
# File 'activesupport/lib/active_support/callbacks.rb', line 201

def call(env)
  target = env.target
  value  = env.value
  halted = env.halted

  if (!halted || !@halting) && user_conditions.all? { |c| c.call(target, value) }
    user_callback.call target, value
  end

  env
end