Sha256: f8220a9b7af89d83087a30801f9b4163508484a44013d0915e4c779f7b1c468a
Contents?: true
Size: 566 Bytes
Versions: 14
Compression:
Stored size: 566 Bytes
Contents
module Blocks class CollectionRenderer < AbstractRenderer def render(runtime_context) collection = runtime_context.collection if collection object_name = runtime_context.as || :object collection.each_with_index do |item, index| item_runtime_context = runtime_context.merge(object_name => item, current_index: index) item_runtime_context.runtime_args = [item] + item_runtime_context.runtime_args yield item_runtime_context end else yield runtime_context end end end end
Version data entries
14 entries across 14 versions & 1 rubygems