Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class SecretAgent < ActiveRecord::Base
- ## Simple Public Properties
- attr_accessor :username
- attr_accessor :password
- ## Our "constructor"
- def initialize
- @username = username
- @password = password
- end
- ## The logic to determine if the password
- ## is good enough for the user to use
- def is_password_secure?
- return false if password.nil?
- return false if password.empty?
- return false if password.size < 4
- return false if @password == 'stirred'
- return false if @password == 'password'
- return false if @password == @username
- true
- end
- end
Add Comment
Please, Sign In to add comment