- delegate_event(method, opts)
- end
-
- # see if each plugin handles +method+, and if so, call it, passing
- # +opts[:args]+ as a parameter. +opts[:above]+ and +opts[:below]+
- # are used for a threshold of botmodule priorities that will be called.
- # If :above is defined, only botmodules with a priority above the value
- # will be called, for example. botmodules are called in order of
- # priority from lowest to hightest.
- def delegate_event(method, o={})
- # if the priorities order of the delegate list is dirty,
- # meaning some modules have been added or priorities have been
- # changed, then the delegate list will need to be sorted before
- # delegation. This should always be true for the first delegation.
- sort_modules unless @sorted_modules
-
- # set defaults
- opts = {:args => []}.merge(o)