This project is archived and is in readonly mode.
:args option for run_callbacks
Patch attached, here's the branch
# * +:args+ - Pass the provided arguments array to each callback method or proc. # Arguments that exeed the arity of the callback method/proc will be silently # discarded rather then generate a warning. String callbacks cannot receieve # arguments. (default: ++ i.e. no arguments will be passed)
def investigate(suspect) run_callback :before_investigation, :args=>[suspect] # ... run_callback :after_investigation, :args=>[suspect] end before_investigation :plant_evidence after_investigation :testify_in_court def plant_evidence(suspect) suspect.plant(INCRIMINATING_STUFF) end def testify_in_court # ... # Note i don't need to expect the (suspect) arg if I'm not going to use it end end