Comparison

util/stanza.lua @ 964:3296db2ad4a0

util.stanza: stanza:reset() method to reset building state
author Matthew Wild <mwild1@gmail.com>
date Wed, 08 Apr 2009 20:12:40 +0100
parent 896:2c0b9e3c11c3
child 1151:8096941b6734
comparison
equal deleted inserted replaced
963:43b140edfd84 964:3296db2ad4a0
60 return self; 60 return self;
61 end 61 end
62 62
63 function stanza_mt:up() 63 function stanza_mt:up()
64 t_remove(self.last_add); 64 t_remove(self.last_add);
65 return self;
66 end
67
68 function stanza_mt:reset()
69 local last_add = self.last_add;
70 for i = 1,#last_add do
71 last_add[i] = nil;
72 end
65 return self; 73 return self;
66 end 74 end
67 75
68 function stanza_mt:add_direct_child(child) 76 function stanza_mt:add_direct_child(child)
69 if type(child) == "table" then 77 if type(child) == "table" then