Sha256: b3f8eff22ac076d9374e657ea0c41bc4059e939c09189eb744b8a2430c452a01

Contents?: true

Size: 531 Bytes

Versions: 12

Compression:

Stored size: 531 Bytes

Contents

module Blocks
  class AdjacentBlocksRenderer < AbstractRenderer
    def render(hook, runtime_context)
      block = block_for(runtime_context.block_name)
      if block
        hooks = block.hooks_for hook
        hooks = hooks.reverse if hook.to_s.index("before") == 0 || hook.to_s.index("prepend") == 0
        hooks.each do |hook_definition|
          hook_runtime_context = runtime_context.extend_to_block_definition(hook_definition)
          block_renderer.render(hook_runtime_context)
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
blocks-3.0.4 lib/blocks/renderers/adjacent_blocks_renderer.rb
blocks-3.0.3 lib/blocks/renderers/adjacent_blocks_renderer.rb
blocks-3.0.2 lib/blocks/renderers/adjacent_blocks_renderer.rb
blocks-3.0.1 lib/blocks/renderers/adjacent_blocks_renderer.rb
blocks-3.0.0 lib/blocks/renderers/adjacent_blocks_renderer.rb
blocks-3.0.0.rc9 lib/blocks/renderers/adjacent_blocks_renderer.rb
blocks-3.0.0.rc8 lib/blocks/renderers/adjacent_blocks_renderer.rb
blocks-3.0.0.rc7 lib/blocks/renderers/adjacent_blocks_renderer.rb
blocks-3.0.0.rc6 lib/blocks/renderers/adjacent_blocks_renderer.rb
blocks-3.0.0.rc5 lib/blocks/renderers/adjacent_blocks_renderer.rb
blocks-3.0.0.rc4 lib/blocks/renderers/adjacent_blocks_renderer.rb
blocks-3.0.0.rc3 lib/blocks/renderers/adjacent_blocks_renderer.rb