Sha256: 3791a9d4f37225f1522d2db8c13f74ac10bb29bd7b66dcb34faf1e07422b9d79

Contents?: true

Size: 427 Bytes

Versions: 2

Compression:

Stored size: 427 Bytes

Contents

module Validators
  def argument_fixed_length_check(arg, fixed_length)
    arg.to_s.length == fixed_length
  end

  def argument_max_length_check(arg, max)
    arg.length <= max
  end

  def argument_min_length_check(arg, min)
    arg.length >= min
  end

  def digits_check(arg, min_digit: 1, max_digit: 6)
    arg.to_s.split('').map { |value| value unless value.to_i.between?(min_digit, max_digit) }.compact.empty?
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
alex_codebreaker-0.1.6 lib/alex_codebreaker/modules/validators/validators.rb
alex_codebreaker-0.1.5 lib/alex_codebreaker/modules/validators/validators.rb