Sha256: 36ac91ea8d842b149606eb70dbfe6c5026d014fe7b2dcc69176d6077d8e81f21
Contents?: true
Size: 446 Bytes
Versions: 26
Compression:
Stored size: 446 Bytes
Contents
module AngularSprinkles class ContentYielder def initialize(args) @context = args.fetch(:context) @yield_to = args.fetch(:yield_to) @cache = args.fetch(:cache) end def call(content) return '' if @cache.set?(content) @cache.set(content) @context.content_tag(:script, content.to_json.html_safe).tap do |script_tag| @context.content_for(@yield_to, script_tag) end end end end
Version data entries
26 entries across 26 versions & 1 rubygems