Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/password_strength_meter.rb

Instance Method Summary collapse

Instance Method Details

#aindices(o) ⇒ Object



102
103
104
105
106
107
# File 'lib/password_strength_meter.rb', line 102

def aindices(o)
  out = Array.new
  select_with_index { |x, i| 
    out << i if x == o }
   out
end

#select_with_indexObject



97
98
99
100
# File 'lib/password_strength_meter.rb', line 97

def select_with_index
  index = -1
  select { |x| index += 1; yield(x, index) }
end