Class: PasswordBlacklist::Checker
- Inherits:
-
Object
- Object
- PasswordBlacklist::Checker
- Defined in:
- lib/password_blacklist/checker.rb
Instance Method Summary collapse
- #blacklisted?(password) ⇒ Boolean
-
#initialize ⇒ Checker
constructor
A new instance of Checker.
- #inspect ⇒ Object
Constructor Details
#initialize ⇒ Checker
Returns a new instance of Checker.
3 4 5 6 7 |
# File 'lib/password_blacklist/checker.rb', line 3 def initialize file_path = File.('../../../data/100k_passwords.txt', __FILE__) @data = File.read(file_path) end |
Instance Method Details
#blacklisted?(password) ⇒ Boolean
9 10 11 |
# File 'lib/password_blacklist/checker.rb', line 9 def blacklisted?(password) !@data.match(/#{Regexp.quote(password)}/).nil? end |
#inspect ⇒ Object
13 14 15 |
# File 'lib/password_blacklist/checker.rb', line 13 def inspect "#<#{self.class}:0x#{__id__.to_s(16)}>" end |