andrii_codebreaker 0.1.4 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/Gemfile.lock +1 -1
 - data/lib/andrii_codebreaker/constants.rb +3 -0
 - data/lib/andrii_codebreaker/difficulty.rb +25 -0
 - data/lib/andrii_codebreaker/game.rb +51 -35
 - data/lib/andrii_codebreaker/user.rb +7 -10
 - data/lib/andrii_codebreaker/version.rb +1 -1
 - data/lib/andrii_codebreaker.rb +1 -1
 - metadata +3 -4
 - data/andrii_codebreaker-0.1.3.gem +0 -0
 - data/lib/andrii_codebreaker/validate/validate.rb +0 -37
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 1a01bba68d09ade8b529e4f4ced95cdbcb32a89d6dc2dc38a9b3f4f89d9bcad6
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: b19b78984073b7017509da2df5159bcc422ff6359432a88257e84a517369e95b
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: b51935c0eb2382f41d9fb8c6859d507eaf7cf21ca7aad9a9f386262ad9b95130af5fdceab79ee424a7b906c934a906bf9358e49316b73e588aebadd5b613939f
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 594d24a0cd286e63d0b6ab241080d629d4b2bc9bbc5648b57cdae0e159997381587ed7e90c1063e6bd5cc75ab99e6449bbff638e70c2b9c0a43b01bff354d15c
         
     | 
    
        data/Gemfile.lock
    CHANGED
    
    
| 
         @@ -0,0 +1,25 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # frozen_string_literal: true
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            module AndriiCodebreaker
         
     | 
| 
      
 4 
     | 
    
         
            +
              class Difficulty
         
     | 
| 
      
 5 
     | 
    
         
            +
                include Constant
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
                attr_reader :difficulty
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
                def initialize(difficulty)
         
     | 
| 
      
 10 
     | 
    
         
            +
                  @difficulty = difficulty
         
     | 
| 
      
 11 
     | 
    
         
            +
                end
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
                def hint
         
     | 
| 
      
 14 
     | 
    
         
            +
                  difficult[:hints]
         
     | 
| 
      
 15 
     | 
    
         
            +
                end
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
                def attempts
         
     | 
| 
      
 18 
     | 
    
         
            +
                  difficult[:attempts]
         
     | 
| 
      
 19 
     | 
    
         
            +
                end
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
                def difficult
         
     | 
| 
      
 22 
     | 
    
         
            +
                  DIFFICULTY[@difficulty.to_sym]
         
     | 
| 
      
 23 
     | 
    
         
            +
                end
         
     | 
| 
      
 24 
     | 
    
         
            +
              end
         
     | 
| 
      
 25 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -2,12 +2,11 @@ 
     | 
|
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            module AndriiCodebreaker
         
     | 
| 
       4 
4 
     | 
    
         
             
              class Game
         
     | 
| 
       5 
     | 
    
         
            -
                include Validate
         
     | 
| 
       6 
5 
     | 
    
         
             
                include Statistic
         
     | 
| 
       7 
6 
     | 
    
         
             
                include Constant
         
     | 
| 
       8 
7 
     | 
    
         | 
| 
       9 
     | 
    
         
            -
                attr_reader :player_name, : 
     | 
| 
       10 
     | 
    
         
            -
                attr_accessor :hints_left, :attempts_left
         
     | 
| 
      
 8 
     | 
    
         
            +
                attr_reader :player_name, :difficulties, :attempts_total, :hints_total, :secret_code, :difficulty
         
     | 
| 
      
 9 
     | 
    
         
            +
                attr_accessor :hints_left, :attempts_left, :secret_code_copy
         
     | 
| 
       11 
10 
     | 
    
         | 
| 
       12 
11 
     | 
    
         
             
                CONST_COMMAND = {
         
     | 
| 
       13 
12 
     | 
    
         
             
                  start: 'start',
         
     | 
| 
         @@ -18,65 +17,82 @@ module AndriiCodebreaker 
     | 
|
| 
       18 
17 
     | 
    
         | 
| 
       19 
18 
     | 
    
         
             
                def initialize(player_name, difficulty)
         
     | 
| 
       20 
19 
     | 
    
         
             
                  @player_name = player_name
         
     | 
| 
       21 
     | 
    
         
            -
                  @ 
     | 
| 
      
 20 
     | 
    
         
            +
                  @difficulties = Difficulty.new(difficulty)
         
     | 
| 
       22 
21 
     | 
    
         
             
                  @attempts_left = 0
         
     | 
| 
       23 
22 
     | 
    
         
             
                  @hints_left = 0
         
     | 
| 
       24 
     | 
    
         
            -
                  initialize_class
         
     | 
| 
       25 
23 
     | 
    
         
             
                end
         
     | 
| 
       26 
24 
     | 
    
         | 
| 
       27 
     | 
    
         
            -
                def  
     | 
| 
       28 
     | 
    
         
            -
                  difficult = DIFFICULTY[@difficulty.to_sym]
         
     | 
| 
       29 
     | 
    
         
            -
                  @hints_total = difficult[:hints]
         
     | 
| 
       30 
     | 
    
         
            -
                  @attempts_total = difficult[:attempts]
         
     | 
| 
      
 25 
     | 
    
         
            +
                def start
         
     | 
| 
       31 
26 
     | 
    
         
             
                  @secret_code = generate_code
         
     | 
| 
      
 27 
     | 
    
         
            +
                  @secret_code_copy = @secret_code.chars
         
     | 
| 
      
 28 
     | 
    
         
            +
                  @hints_total = @difficulties.hint
         
     | 
| 
      
 29 
     | 
    
         
            +
                  @attempts_total = @difficulties.attempts
         
     | 
| 
      
 30 
     | 
    
         
            +
                  @difficulty = @difficulties.difficulty
         
     | 
| 
       32 
31 
     | 
    
         
             
                end
         
     | 
| 
       33 
32 
     | 
    
         | 
| 
       34 
     | 
    
         
            -
                def  
     | 
| 
       35 
     | 
    
         
            -
                  hints_left
         
     | 
| 
      
 33 
     | 
    
         
            +
                def hints
         
     | 
| 
      
 34 
     | 
    
         
            +
                  return unless @hints_total > @hints_left
         
     | 
| 
      
 35 
     | 
    
         
            +
             
     | 
| 
      
 36 
     | 
    
         
            +
                  @hints_left += 1
         
     | 
| 
      
 37 
     | 
    
         
            +
                  @secret_code_copy.pop
         
     | 
| 
       36 
38 
     | 
    
         
             
                end
         
     | 
| 
       37 
39 
     | 
    
         | 
| 
       38 
40 
     | 
    
         
             
                def compare_codes(guess)
         
     | 
| 
       39 
     | 
    
         
            -
                  return ' 
     | 
| 
      
 41 
     | 
    
         
            +
                  return '' if !guess.match(/^[1-6]{4}$/) && !guess.match(/^\?$/)
         
     | 
| 
      
 42 
     | 
    
         
            +
                  return WIN if guess == @secret_code
         
     | 
| 
      
 43 
     | 
    
         
            +
             
     | 
| 
      
 44 
     | 
    
         
            +
                  result = ''
         
     | 
| 
      
 45 
     | 
    
         
            +
                  index = []
         
     | 
| 
      
 46 
     | 
    
         
            +
                  code_guess = string_to_integer(guess)
         
     | 
| 
      
 47 
     | 
    
         
            +
                  secret_code = string_to_integer(@secret_code)
         
     | 
| 
      
 48 
     | 
    
         
            +
             
     | 
| 
      
 49 
     | 
    
         
            +
                  result, index = check_plus(code_guess, result, secret_code, index)
         
     | 
| 
      
 50 
     | 
    
         
            +
             
     | 
| 
      
 51 
     | 
    
         
            +
                  delete_index(code_guess, index)
         
     | 
| 
      
 52 
     | 
    
         
            +
                  delete_index(secret_code, index)
         
     | 
| 
       40 
53 
     | 
    
         | 
| 
       41 
     | 
    
         
            -
                  ( 
     | 
| 
      
 54 
     | 
    
         
            +
                  check_minus(code_guess, result, secret_code, index)
         
     | 
| 
       42 
55 
     | 
    
         
             
                end
         
     | 
| 
       43 
56 
     | 
    
         | 
| 
       44 
57 
     | 
    
         
             
                private
         
     | 
| 
       45 
58 
     | 
    
         | 
| 
       46 
     | 
    
         
            -
                def  
     | 
| 
       47 
     | 
    
         
            -
                   
     | 
| 
       48 
     | 
    
         
            -
                end
         
     | 
| 
      
 59 
     | 
    
         
            +
                def check_plus(*info)
         
     | 
| 
      
 60 
     | 
    
         
            +
                  code_guess, result, secret_code, index = info
         
     | 
| 
       49 
61 
     | 
    
         | 
| 
       50 
     | 
    
         
            -
             
     | 
| 
       51 
     | 
    
         
            -
             
     | 
| 
       52 
     | 
    
         
            -
             
     | 
| 
       53 
     | 
    
         
            -
             
     | 
| 
      
 62 
     | 
    
         
            +
                  code_guess.each_index do |i|
         
     | 
| 
      
 63 
     | 
    
         
            +
                    if code_guess[i] == secret_code[i]
         
     | 
| 
      
 64 
     | 
    
         
            +
                      result += PLUS
         
     | 
| 
      
 65 
     | 
    
         
            +
                      index << i
         
     | 
| 
      
 66 
     | 
    
         
            +
                    end
         
     | 
| 
      
 67 
     | 
    
         
            +
                  end
         
     | 
| 
      
 68 
     | 
    
         
            +
                  [result, index]
         
     | 
| 
       54 
69 
     | 
    
         
             
                end
         
     | 
| 
       55 
70 
     | 
    
         | 
| 
       56 
     | 
    
         
            -
                def  
     | 
| 
       57 
     | 
    
         
            -
                   
     | 
| 
       58 
     | 
    
         
            -
             
     | 
| 
       59 
     | 
    
         
            -
             
     | 
| 
       60 
     | 
    
         
            -
                  arr[1].each do |number|
         
     | 
| 
       61 
     | 
    
         
            -
                    next unless arr[0].include?(number)
         
     | 
| 
      
 71 
     | 
    
         
            +
                def check_minus(*info)
         
     | 
| 
      
 72 
     | 
    
         
            +
                  code_guess, result, secret_code, index = info
         
     | 
| 
      
 73 
     | 
    
         
            +
                  code_guess.each do |i|
         
     | 
| 
      
 74 
     | 
    
         
            +
                    next unless secret_code.include?(i)
         
     | 
| 
       62 
75 
     | 
    
         | 
| 
       63 
     | 
    
         
            -
                     
     | 
| 
      
 76 
     | 
    
         
            +
                    result += MINUS
         
     | 
| 
      
 77 
     | 
    
         
            +
                    index = secret_code.index(i)
         
     | 
| 
      
 78 
     | 
    
         
            +
                    secret_code.delete_at(index)
         
     | 
| 
       64 
79 
     | 
    
         
             
                  end
         
     | 
| 
       65 
     | 
    
         
            -
                   
     | 
| 
      
 80 
     | 
    
         
            +
                  result
         
     | 
| 
       66 
81 
     | 
    
         
             
                end
         
     | 
| 
       67 
82 
     | 
    
         | 
| 
       68 
     | 
    
         
            -
                def  
     | 
| 
       69 
     | 
    
         
            -
                   
     | 
| 
      
 83 
     | 
    
         
            +
                def string_to_integer(input_code)
         
     | 
| 
      
 84 
     | 
    
         
            +
                  array_int = []
         
     | 
| 
      
 85 
     | 
    
         
            +
                  array_chars = input_code.chars
         
     | 
| 
      
 86 
     | 
    
         
            +
                  array_chars.each { |i| array_int << i.to_i }
         
     | 
| 
      
 87 
     | 
    
         
            +
                  array_int
         
     | 
| 
       70 
88 
     | 
    
         
             
                end
         
     | 
| 
       71 
89 
     | 
    
         | 
| 
       72 
     | 
    
         
            -
                def  
     | 
| 
       73 
     | 
    
         
            -
                   
     | 
| 
       74 
     | 
    
         
            -
                    .delete_if { |el| el[0] == el[1] }
         
     | 
| 
       75 
     | 
    
         
            -
                    .transpose
         
     | 
| 
      
 90 
     | 
    
         
            +
                def delete_index(array, index)
         
     | 
| 
      
 91 
     | 
    
         
            +
                  array.map!.with_index { |item, i| item unless index.include?(i) }.compact!
         
     | 
| 
       76 
92 
     | 
    
         
             
                end
         
     | 
| 
       77 
93 
     | 
    
         | 
| 
       78 
94 
     | 
    
         
             
                def generate_code
         
     | 
| 
       79 
     | 
    
         
            -
                  ( 
     | 
| 
      
 95 
     | 
    
         
            +
                  (CODE_START_LENGTH..CODE_LENGTH_COUNT).map { rand(CODE_START_LENGTH..CODE_LENGTH) }.join
         
     | 
| 
       80 
96 
     | 
    
         
             
                end
         
     | 
| 
       81 
97 
     | 
    
         
             
              end
         
     | 
| 
       82 
98 
     | 
    
         
             
            end
         
     | 
| 
         @@ -2,25 +2,22 @@ 
     | 
|
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            module AndriiCodebreaker
         
     | 
| 
       4 
4 
     | 
    
         
             
              class User
         
     | 
| 
       5 
     | 
    
         
            -
                include  
     | 
| 
      
 5 
     | 
    
         
            +
                include Constant
         
     | 
| 
       6 
6 
     | 
    
         | 
| 
       7 
7 
     | 
    
         
             
                attr_reader :name
         
     | 
| 
       8 
8 
     | 
    
         | 
| 
       9 
9 
     | 
    
         
             
                def initialize(name)
         
     | 
| 
       10 
     | 
    
         
            -
                  @name = name
         
     | 
| 
       11 
     | 
    
         
            -
                  validate_name
         
     | 
| 
      
 10 
     | 
    
         
            +
                  @name = validates_name(name)
         
     | 
| 
       12 
11 
     | 
    
         
             
                end
         
     | 
| 
       13 
12 
     | 
    
         | 
| 
       14 
     | 
    
         
            -
                 
     | 
| 
       15 
     | 
    
         
            -
                  return unless user.hints_total > user.hints_left
         
     | 
| 
      
 13 
     | 
    
         
            +
                private
         
     | 
| 
       16 
14 
     | 
    
         | 
| 
       17 
     | 
    
         
            -
             
     | 
| 
      
 15 
     | 
    
         
            +
                def validates_name(name)
         
     | 
| 
      
 16 
     | 
    
         
            +
                  name if valid_name?(name)
         
     | 
| 
       18 
17 
     | 
    
         
             
                end
         
     | 
| 
       19 
18 
     | 
    
         | 
| 
       20 
     | 
    
         
            -
                 
     | 
| 
       21 
     | 
    
         
            -
             
     | 
| 
       22 
     | 
    
         
            -
                def validate_name
         
     | 
| 
       23 
     | 
    
         
            -
                  @name = validates_name(name)
         
     | 
| 
      
 19 
     | 
    
         
            +
                def valid_name?(name)
         
     | 
| 
      
 20 
     | 
    
         
            +
                  name.length >= NAME_MIN_LENGTH && name.length <= NAME_MAX_LENGTH
         
     | 
| 
       24 
21 
     | 
    
         
             
                end
         
     | 
| 
       25 
22 
     | 
    
         
             
              end
         
     | 
| 
       26 
23 
     | 
    
         
             
            end
         
     | 
    
        data/lib/andrii_codebreaker.rb
    CHANGED
    
    | 
         @@ -2,9 +2,9 @@ 
     | 
|
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            require 'yaml'
         
     | 
| 
       4 
4 
     | 
    
         
             
            require_relative 'andrii_codebreaker/constants'
         
     | 
| 
       5 
     | 
    
         
            -
            require_relative 'andrii_codebreaker/validate/validate'
         
     | 
| 
       6 
5 
     | 
    
         
             
            require_relative 'andrii_codebreaker/model'
         
     | 
| 
       7 
6 
     | 
    
         
             
            require_relative 'andrii_codebreaker/user'
         
     | 
| 
      
 7 
     | 
    
         
            +
            require_relative 'andrii_codebreaker/difficulty'
         
     | 
| 
       8 
8 
     | 
    
         
             
            require_relative 'andrii_codebreaker/statistic'
         
     | 
| 
       9 
9 
     | 
    
         
             
            require_relative 'andrii_codebreaker/version'
         
     | 
| 
       10 
10 
     | 
    
         
             
            require_relative 'andrii_codebreaker/game'
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: andrii_codebreaker
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.1. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.1.8
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Andrii
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire:
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2021-11- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2021-11-21 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: fasterer
         
     | 
| 
         @@ -127,17 +127,16 @@ files: 
     | 
|
| 
       127 
127 
     | 
    
         
             
            - LICENSE.txt
         
     | 
| 
       128 
128 
     | 
    
         
             
            - README.md
         
     | 
| 
       129 
129 
     | 
    
         
             
            - Rakefile
         
     | 
| 
       130 
     | 
    
         
            -
            - andrii_codebreaker-0.1.3.gem
         
     | 
| 
       131 
130 
     | 
    
         
             
            - andrii_codebreaker.gemspec
         
     | 
| 
       132 
131 
     | 
    
         
             
            - bin/console
         
     | 
| 
       133 
132 
     | 
    
         
             
            - bin/setup
         
     | 
| 
       134 
133 
     | 
    
         
             
            - lib/andrii_codebreaker.rb
         
     | 
| 
       135 
134 
     | 
    
         
             
            - lib/andrii_codebreaker/constants.rb
         
     | 
| 
      
 135 
     | 
    
         
            +
            - lib/andrii_codebreaker/difficulty.rb
         
     | 
| 
       136 
136 
     | 
    
         
             
            - lib/andrii_codebreaker/game.rb
         
     | 
| 
       137 
137 
     | 
    
         
             
            - lib/andrii_codebreaker/model.rb
         
     | 
| 
       138 
138 
     | 
    
         
             
            - lib/andrii_codebreaker/statistic.rb
         
     | 
| 
       139 
139 
     | 
    
         
             
            - lib/andrii_codebreaker/user.rb
         
     | 
| 
       140 
     | 
    
         
            -
            - lib/andrii_codebreaker/validate/validate.rb
         
     | 
| 
       141 
140 
     | 
    
         
             
            - lib/andrii_codebreaker/version.rb
         
     | 
| 
       142 
141 
     | 
    
         
             
            homepage: https://github.com/Andrii-RubyGarage/Codebreker-Gem
         
     | 
| 
       143 
142 
     | 
    
         
             
            licenses:
         
     | 
| 
         Binary file 
     | 
| 
         @@ -1,37 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            # frozen_string_literal: true
         
     | 
| 
       2 
     | 
    
         
            -
             
     | 
| 
       3 
     | 
    
         
            -
            module AndriiCodebreaker
         
     | 
| 
       4 
     | 
    
         
            -
              module Validate
         
     | 
| 
       5 
     | 
    
         
            -
                include Constant
         
     | 
| 
       6 
     | 
    
         
            -
             
     | 
| 
       7 
     | 
    
         
            -
                def validates_name(name)
         
     | 
| 
       8 
     | 
    
         
            -
                  name if valid_name?(name)
         
     | 
| 
       9 
     | 
    
         
            -
                end
         
     | 
| 
       10 
     | 
    
         
            -
             
     | 
| 
       11 
     | 
    
         
            -
                def validate_guess(code)
         
     | 
| 
       12 
     | 
    
         
            -
                  code = string_to_integer(code)
         
     | 
| 
       13 
     | 
    
         
            -
                  true if check_code_length?(code) && check_numbers?(code)
         
     | 
| 
       14 
     | 
    
         
            -
                end
         
     | 
| 
       15 
     | 
    
         
            -
             
     | 
| 
       16 
     | 
    
         
            -
                private
         
     | 
| 
       17 
     | 
    
         
            -
             
     | 
| 
       18 
     | 
    
         
            -
                def string_to_integer(input_code)
         
     | 
| 
       19 
     | 
    
         
            -
                  array_int = []
         
     | 
| 
       20 
     | 
    
         
            -
                  array_chars = input_code.chars
         
     | 
| 
       21 
     | 
    
         
            -
                  array_chars.each { |i| array_int << i.to_i }
         
     | 
| 
       22 
     | 
    
         
            -
                  array_int
         
     | 
| 
       23 
     | 
    
         
            -
                end
         
     | 
| 
       24 
     | 
    
         
            -
             
     | 
| 
       25 
     | 
    
         
            -
                def valid_name?(name)
         
     | 
| 
       26 
     | 
    
         
            -
                  name.length >= NAME_MIN_LENGTH && name.length <= NAME_MAX_LENGTH
         
     | 
| 
       27 
     | 
    
         
            -
                end
         
     | 
| 
       28 
     | 
    
         
            -
             
     | 
| 
       29 
     | 
    
         
            -
                def check_code_length?(code)
         
     | 
| 
       30 
     | 
    
         
            -
                  code.length == CODE_LENGTH_COUNT
         
     | 
| 
       31 
     | 
    
         
            -
                end
         
     | 
| 
       32 
     | 
    
         
            -
             
     | 
| 
       33 
     | 
    
         
            -
                def check_numbers?(code)
         
     | 
| 
       34 
     | 
    
         
            -
                  code.all? { |value| value.between?(CODE_START_LENGTH, CODE_LENGTH) }
         
     | 
| 
       35 
     | 
    
         
            -
                end
         
     | 
| 
       36 
     | 
    
         
            -
              end
         
     | 
| 
       37 
     | 
    
         
            -
            end
         
     |