Class: Array

Inherits:
Object show all
Defined in:
lib/platform_helpers/array.rb

Instance Method Summary collapse

Instance Method Details

#delete_allObject



8
9
10
# File 'lib/platform_helpers/array.rb', line 8

def delete_all
  self.length.times {self.pop}
end

#ppObject

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_boolObject



25
26
27
# File 'lib/platform_helpers/array.rb', line 25

def to_bool
  length > 0 ? true : false
end