Method: ClassX::Pluggable#call_event
- Defined in:
- lib/classx/pluggable.rb
#call_event(name, *args) ⇒ Object
invoke registered event of name with args. and return array of result each callback.
117 118 119 120 121 122 123 124 125 126 |
# File 'lib/classx/pluggable.rb', line 117 def call_event name, *args name = name.to_s if events = self.__classx_pluggable_events_of[name] events.map do |event| event[:plugin].__send__(event[:method], *args) end else [] end end |