module Roda::RodaPlugins::EachPart

The each_part plugin adds an each_part method, which is a render_each-like method that treats all keywords as locals.

# Can replace this:
render_each(enum, :template, locals: {foo: 'bar'})

# With this:
each_part(enum, :template, foo: 'bar')

On Ruby 2.7+, the part method takes a keyword splat, so you must pass keywords and not a positional hash for the locals.

If you are using the :assume_fixed_locals render plugin option, template caching is enabled, you are using Ruby 3+, and you are freezing your Roda application, in addition to providing a simpler API, this also provides a performance improvement.