class CallbacksTest::AbstractCallbackTerminator
Attributes
halted[R]
history[R]
saved[R]
Public Class Methods
new()
click to toggle source
# File activesupport/test/callbacks_test.rb, line 624 def initialize @history = [] end
set_save_callbacks()
click to toggle source
# File activesupport/test/callbacks_test.rb, line 613 def self.set_save_callbacks set_callback :save, :before, :first set_callback :save, :before, :second set_callback :save, :around, :around_it set_callback :save, :before, :third set_callback :save, :after, :first set_callback :save, :around, :around_it set_callback :save, :after, :third end
Public Instance Methods
around_it() { || ... }
click to toggle source
# File activesupport/test/callbacks_test.rb, line 628 def around_it @history << "around1" yield @history << "around2" end
first()
click to toggle source
# File activesupport/test/callbacks_test.rb, line 634 def first @history << "first" end
halted_callback_hook(filter)
click to toggle source
# File activesupport/test/callbacks_test.rb, line 653 def halted_callback_hook(filter) @halted = filter end
save()
click to toggle source
# File activesupport/test/callbacks_test.rb, line 647 def save run_callbacks :save do @saved = true end end
second()
click to toggle source
# File activesupport/test/callbacks_test.rb, line 638 def second @history << "second" :halt end
third()
click to toggle source
# File activesupport/test/callbacks_test.rb, line 643 def third @history << "third" end