module MasterView module DirectiveTests class TestEventsDirective < MasterView::DirectiveBase DEBUG_MD_LOADING = false if DEBUG_MD_LOADING STDOUT.puts "\n###DEBUG #{self.name} METADATA LOADING ###" STDOUT.puts "...DirectiveMetadataRegistry (#{MasterView::DirectiveMetadata::DirectiveMetadataRegistry[self.name].object_id}): #{MasterView::DirectiveMetadata::DirectiveMetadataRegistry[self.name].inspect})" STDOUT.puts "...before md decls: metadata_values=#{metadata_values.object_id}: #{metadata_values.inspect}" end metadata :namespace => 'mvtest', :attribute_name => 'test_events', :priority => 'Low' if DEBUG_MD_LOADING STDOUT.puts "AFTER metadata DECLS:" STDOUT.puts "...DirectiveMetadataRegistry (#{MasterView::DirectiveMetadata::DirectiveMetadataRegistry[self.name].object_id}): #{MasterView::DirectiveMetadata::DirectiveMetadataRegistry[self.name].inspect})" STDOUT.puts "...after md decls: metadata_values #{metadata_values.object_id}: #{metadata_values.inspect}" end event :stag do render ' stag ' render render_result render ' stagend ' end # sub-event notification w/in document content processing def characters(dcs) ret = [] ret << ' charsstart ' ret << dcs.render ret << ' charsend ' end # sub-event notification w/in document content processing def comment(dcs) ret = [] ret << ' commentstart ' ret << dcs.render ret << ' commentend ' end # sub-event notification w/in document content processing def cdata(dcs) ret = [] ret << ' cdatastart ' ret << dcs.render ret << ' cdataend ' end event :etag do render ' etag ' render render_result render ' etagend ' end event :before_child_title_stag do render ' before_child_title_stag ' end event :child_title_content do render attr_value end end end end