Sha256: 9b1f7e76dcad9ba4c2e637a57bbb441e70094080b4bbfd5dae7efeaa03ef4813
Contents?: true
Size: 643 Bytes
Versions: 22
Compression:
Stored size: 643 Bytes
Contents
# frozen_string_literal: true require "concurrent/map" module ActionView class UnboundTemplate def initialize(source, identifer, handler, options) @source = source @identifer = identifer @handler = handler @options = options @templates = Concurrent::Map.new(initial_capacity: 2) end def bind_locals(locals) @templates[locals] ||= build_template(locals) end private def build_template(locals) options = @options.merge(locals: locals) Template.new( @source, @identifer, @handler, **options ) end end end
Version data entries
22 entries across 22 versions & 1 rubygems