Guest User

Untitled

a guest
Mar 13th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. class SecretAgent < ActiveRecord::Base
  2.  
  3. ## Simple Public Properties
  4. attr_accessor :username
  5. attr_accessor :password
  6.  
  7. ## Our "constructor"
  8. def initialize
  9. @username = username
  10. @password = password
  11. end
  12.  
  13. ## The logic to determine if the password
  14. ## is good enough for the user to use
  15. def is_password_secure?
  16. return false if password.nil?
  17. return false if password.empty?
  18. return false if password.size < 4
  19. return false if @password == 'stirred'
  20. return false if @password == 'password'
  21. return false if @password == @username
  22. true
  23. end
  24. end
Add Comment
Please, Sign In to add comment