Class: Validate
- Inherits:
-
Object
- Object
- Validate
- Defined in:
- lib/ang_ttt_gem/validate.rb
Instance Method Summary collapse
- #mark_input(input) ⇒ Object
- #number_input(input) ⇒ Object
- #play_again_input(input) ⇒ Object
- #player_input(input) ⇒ Object
Instance Method Details
#mark_input(input) ⇒ Object
8 9 10 11 |
# File 'lib/ang_ttt_gem/validate.rb', line 8 def mark_input(input) return false unless input =~ /[a-zA-Z]/ return true end |
#number_input(input) ⇒ Object
13 14 15 16 |
# File 'lib/ang_ttt_gem/validate.rb', line 13 def number_input(input) return false unless input =~ /[1-9]/ return true end |
#play_again_input(input) ⇒ Object
18 19 20 21 |
# File 'lib/ang_ttt_gem/validate.rb', line 18 def play_again_input(input) return false unless input =~ /[Nn,Yy]/ return true end |
#player_input(input) ⇒ Object
3 4 5 6 |
# File 'lib/ang_ttt_gem/validate.rb', line 3 def player_input(input) return false unless input =~ /[Hh,Cc]/ return true end |