Module: Textus::Hooks::Dsl

Included in:
Textus
Defined in:
lib/textus/hooks/dsl.rb

Instance Method Summary collapse

Instance Method Details

#on(event, name, &blk) ⇒ Object

Raises:



4
5
6
7
8
# File 'lib/textus/hooks/dsl.rb', line 4

def on(event, name, **, &blk)
  raise UsageError.new("hook needs a block") unless blk

  Loader.current_registry.register(event, name, **, &blk)
end