Module: Trestle::Hook::Helpers
- Included in:
- Form::Renderer, Trestle::HookHelper
- Defined in:
- lib/trestle/hook/helpers.rb
Instance Method Summary collapse
Instance Method Details
#hook(name, *args, &block) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/trestle/hook/helpers.rb', line 4 def hook(name, *args, &block) hooks = hooks(name) if hooks.any? safe_join(hooks.map { |hook| hook.evaluate(self, *args) }, "\n") elsif block_given? capture(*args, &block) end end |
#hook?(name) ⇒ Boolean
16 17 18 |
# File 'lib/trestle/hook/helpers.rb', line 16 def hook?(name) hooks(name).any? end |