class Array
def compact_blank!
Experimental RBS support (using type sampling data from the type_fusion
project).
def compact_blank!: () -> untyped
This signature was generated using 1 sample from 1 application.
a.compact_blank!
a = [1, "", nil, 2, " ", [], {}, false, true]
Uses Object#blank? for determining if an item is blank.
Removes all blank elements from the +Array+ in place and returns self.
def compact_blank! # use delete_if rather than reject! because it always returns self even if nothing changed delete_if(&:blank?) end