Sha256: e9693f55592aa5226537f5e3620661f0f208c70f717952d44a95b32f5ef40bf6

Contents?: true

Size: 403 Bytes

Versions: 8

Compression:

Stored size: 403 Bytes

Contents

# frozen_string_literal: true

module Codebreaker
  module Modules
    module Validator
      VALUE_FORMAT = /^[1-6]{4}$/.freeze

      def check_emptyness(value)
        value.empty?
      end

      def check_length(value, min_size, max_size)
        value.size.between?(min_size, max_size)
      end

      def check_command_range(command)
        command =~ VALUE_FORMAT
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
codebreaker_marian-0.1.8 lib/codebreaker_marian/modules/validator.rb
codebreaker_marian-0.1.7 lib/codebreaker_marian/modules/validator.rb
codebreaker_marian-0.1.6 lib/codebreaker_marian/modules/validator.rb
codebreaker_marian-0.1.5 lib/codebreaker/modules/validator.rb
codebreaker-yeroshek-0.1.5 lib/codebreaker/modules/validator.rb
codebreaker-yeroshek-0.1.4 lib/codebreaker/modules/validator.rb
codebreaker-yeroshek-0.1.3 lib/codebreaker/modules/validator.rb
codebreaker-yeroshek-0.1.2 lib/codebreaker/modules/validator.rb