Class: Zxcvbn::Omnimatch
- Inherits:
-
Object
- Object
- Zxcvbn::Omnimatch
- Defined in:
- lib/zxcvbn/omnimatch.rb
Instance Method Summary collapse
-
#initialize(data) ⇒ Omnimatch
constructor
A new instance of Omnimatch.
- #matches(password, user_inputs = []) ⇒ Object
Constructor Details
#initialize(data) ⇒ Omnimatch
Returns a new instance of Omnimatch.
15 16 17 18 |
# File 'lib/zxcvbn/omnimatch.rb', line 15 def initialize(data) @data = data @matchers = build_matchers end |
Instance Method Details
#matches(password, user_inputs = []) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/zxcvbn/omnimatch.rb', line 20 def matches(password, user_inputs = []) matchers = @matchers + user_input_matchers(user_inputs) matchers.map do |matcher| matcher.matches(password) end.inject(&:+) end |