138: def method_missing(sym, *args, &block)
139: args.each do |arg|
140: @stream.delete_if { |x| x.object_id == arg.object_id }
141: end
142: if TAGS.include?(sym)
143: if args.empty? and block.nil?
144: return CssProxy.new do |args, block|
145: tag!(sym, *args, &block)
146: end
147: end
148: tag!(sym, *args, &block)
149: elsif SELF_CLOSING_TAGS.include?(sym)
150: tag!(sym, *args)
151: elsif instance_variable_get("@#{sym}")
152: instance_variable_get("@#{sym}")
153: elsif @helpers.respond_to?(sym)
154: r = @helpers.send(sym, *args, &block)
155: @builder << r if @output_helpers
156: r
157: else
158: tag!(sym, *args, &block)
159: end
160: end