Sha256: 1734601fd00c66e0c57841014e98d358ec687cbcb93087dff52439d2b4a1bded
Contents?: true
Size: 582 Bytes
Versions: 42
Compression:
Stored size: 582 Bytes
Contents
module Virgo module HooksHelper def hook(hook_name) body = "" (@hook_content[hook_name] || []).each do |markup| body += raw(markup) end body end 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 private # do not call directly def add_hook_content(hook_name, content) @hook_content ||= {} @hook_content[hook_name] ||= [] @hook_content[hook_name] << content end end end
Version data entries
42 entries across 42 versions & 1 rubygems