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