= private = protected
clear()
Removes all elements from self.
a = [ "a", "b", "c", "d", "e" ] a.clear #=> [ ]
VALUE rb_ary_clear(VALUE ary) { rb_ary_modify(ary); ARY_SET_LEN(ary, 0); if (ARY_DEFAULT_SIZE * 2 < ARY_CAPA(ary)) { ary_resize_capa(ary, ARY_DEFAULT_SIZE * 2); } return ary; }