Sha256: 1aceab6c90593c9bbdc875e935e5a7b255f8653b19c56983aff4f2a42849fab5

Contents?: true

Size: 329 Bytes

Versions: 6

Compression:

Stored size: 329 Bytes

Contents

# frozen_string_literal: true

module Codebreaker
  module Validation
    MIN_NAME_LENGTH = 3
    MAX_NAME_LENGTH = 20
    def name_is_valid?(name)
      name.instance_of?(String) && name.length.between?(MIN_NAME_LENGTH, MAX_NAME_LENGTH)
    end

    def input_is_valid?(input)
      /^[1-6]{4}$/.match?(input)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
codebreaker_kub-0.2.6 lib/codebreaker/validation.rb
codebreaker_kub-0.2.5 lib/codebreaker/validation.rb
codebreaker_kub-0.2.4 lib/codebreaker/validation.rb
codebreaker_kub-0.2.3 lib/codebreaker/validation.rb
codebreaker_kub-0.2.2 lib/codebreaker/validation.rb
codebreaker_kub-0.2.1 lib/codebreaker/validation.rb