module MasterView module Directives # outputs an if/end block around the text tags # class If < MasterView::DirectiveBase metadata :priority => 'High', :category => 'erb', :description => 'Wraps the element with an if... end block using the attribute value for the condition' #TODO: omit element entirely if attr_value == 'false' #TODO: don't need to generate conditional block wrapping if attr_value == 'true' event :before_stag do render erb_eval( 'if', attr_value ) end event :after_etag do render erb_eval( 'end' ) end end end end