Class: GatesOfHeaven::Doorman
- Inherits:
-
Object
- Object
- GatesOfHeaven::Doorman
- Defined in:
- lib/gates_of_heaven/doorman.rb
Instance Method Summary collapse
- #guard ⇒ Object
-
#initialize(password) ⇒ Doorman
constructor
A new instance of Doorman.
Constructor Details
#initialize(password) ⇒ Doorman
Returns a new instance of Doorman.
3 4 5 |
# File 'lib/gates_of_heaven/doorman.rb', line 3 def initialize(password) @password = password.dup end |
Instance Method Details
#guard ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/gates_of_heaven/doorman.rb', line 7 def guard case when @password.length <= 6 'Password too short' when !@password.match(/\d/) 'Password needs numbers' else nil end end |