Module: Basilico
- Extended by:
- Basilico
- Included in:
- Basilico
- Defined in:
- lib/basilico.rb,
lib/basilico/version.rb,
lib/basilico/app_helpers.rb,
lib/basilico/event_handler.rb
Defined Under Namespace
Modules: AppHelpers
Classes: EventHandler
Constant Summary
collapse
- EVENTS =
%w{start interrupt interrupt_over reset resume end break_end every}
- VERSION =
"0.0.1"
Instance Method Summary
collapse
Instance Method Details
#add_handler(klass) ⇒ Object
13
14
15
|
# File 'lib/basilico.rb', line 13
def add_handler(klass)
handlers << klass
end
|
#handlers ⇒ Object
9
10
11
|
# File 'lib/basilico.rb', line 9
def handlers
@event_handlers ||= []
end
|
#run_all(event, *vars) ⇒ Object
17
18
19
20
21
22
23
|
# File 'lib/basilico.rb', line 17
def run_all(event, *vars)
options = parse_variables(vars.flatten)
handlers.each do |handler|
next unless handler.handles?(event)
handler.new.send(event, options)
end
end
|