--- tags: minimeet, Rails --- # ActiveSupport::Callbacks > https://api.rubyonrails.org/classes/ActiveSupport/Callbacks.html ```ruby! class AAA include ::ActiveSupport::Callbacks define_callbacks :perform def perform puts '--- perform start ---' # run_callbacks :perform run_callbacks :perform do puts 'around perform' end puts '--- perform end ---' end end class BBB < AAA set_callback :perform, :before, :before_perform set_callback :perform, :after, :after_perform # set_callback :perform, :after_perform # set_callback :perform, :before_perform def before_perform puts __method__ end def after_perform puts __method__ end end BBB.new.perform ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up