Class: Array
Instance Method Summary collapse
- #delete_all ⇒ Object
-
#pp ⇒ Object
def delete(search) if search.kind_of?(Regexp) self.each_with_index { |i, ct| self.delete_at(ct) if i =~ search } else super end end.
- #to_bool ⇒ Object
Instance Method Details
#delete_all ⇒ Object
8 9 10 |
# File 'lib/platform_helpers/array.rb', line 8 def delete_all self.length.times {self.pop} end |
#pp ⇒ Object
def delete(search)
if search.kind_of?(Regexp)
self.each_with_index { |i, ct| self.delete_at(ct) if i =~ search }
else
super
end
end
20 21 22 23 |
# File 'lib/platform_helpers/array.rb', line 20 def pp self.flatten self.join(' ') end |
#to_bool ⇒ Object
25 26 27 |
# File 'lib/platform_helpers/array.rb', line 25 def to_bool length > 0 ? true : false end |