Class: Zxcvbn::Omnimatch

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

Instance Method Summary collapse

Constructor Details

#initializeOmnimatch

Returns a new instance of Omnimatch.



7
8
9
# File 'lib/zxcvbn/omnimatch.rb', line 7

def initialize
  @matchers = build_matchers
end

Instance Method Details

#matches(password, user_inputs = []) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/zxcvbn/omnimatch.rb', line 11

def matches(password, user_inputs = [])
  result = []
  (@matchers + user_input_matchers(user_inputs)).each do |matcher|
    result += matcher.matches(password)
  end
  result
end