Module: Virgo::HooksHelper

Defined in:
app/helpers/virgo/hooks_helper.rb

Instance Method Summary collapse

Instance Method Details

#for_hook(hook_name, &block) ⇒ Object


13
14
15
16
17
18
19
# File 'app/helpers/virgo/hooks_helper.rb', line 13

def for_hook(hook_name, &block)
  markup = capture(&block)

  add_hook_content(hook_name, markup)

  "" # just in case the user echoes the helper invocation
end

#hook(hook_name) ⇒ Object


3
4
5
6
7
8
9
10
11
# File 'app/helpers/virgo/hooks_helper.rb', line 3

def hook(hook_name)
  body = ""

  (@hook_content[hook_name] || []).each do |markup|
    body += raw(markup)
  end

  body
end