Sha256: e290e7d0d5f59febcc698197e658398fa48e2667ae33551fd95203a8aaf861f9
Contents?: true
Size: 949 Bytes
Versions: 9
Compression:
Stored size: 949 Bytes
Contents
require 'volt/page/bindings/base_binding' class TemplateRenderer < BaseBinding attr_reader :context def initialize(page, target, context, binding_name, template_name) # puts "new template renderer: #{context.inspect} - #{binding_name.inspect}" super(page, target, context, binding_name) # puts "Template Name: #{template_name}" @sub_bindings = [] bindings = self.section.set_content_to_template(page, template_name) bindings.each_pair do |id,bindings_for_id| bindings_for_id.each do |binding| @sub_bindings << binding.call(page, target, context, id) end end end def remove # puts "Remove Template: #{self} - #{@sub_bindings.inspect}" # Remove all of the sub-bindings # @sub_bindings.each(&:remove) @sub_bindings.each do |binding| # puts "REMOVE: #{binding.inspect}" binding.remove # puts "REMOVED" end @sub_bindings = [] super end end
Version data entries
9 entries across 9 versions & 1 rubygems