Sha256: 8dda34e8cf7b3331a159af9ddca9ea6778517115900b1908fa23c72a2491e0a2

Contents?: true

Size: 477 Bytes

Versions: 11

Compression:

Stored size: 477 Bytes

Contents

module AlexCodebreaker
  module Modules
    module Validators
      def argument_length_check(arg, length)
        arg.to_s.length == 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, max_digit)
        arg.split('').all? { |value| value.to_i.between?(min_digit, max_digit) }
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
alex_codebreaker-0.2.3 lib/alex_codebreaker/modules/validators.rb
alex_codebreaker-0.2.2 lib/alex_codebreaker/modules/validators.rb
alex_codebreaker-0.2.1 lib/alex_codebreaker/modules/validators.rb
alex_codebreaker-0.2.0 lib/alex_codebreaker/modules/validators.rb
alex_codebreaker-0.1.13 lib/alex_codebreaker/modules/validators.rb
alex_codebreaker-0.1.12 lib/alex_codebreaker/modules/validators.rb
alex_codebreaker-0.1.11 lib/alex_codebreaker/modules/validators.rb
alex_codebreaker-0.1.10 lib/alex_codebreaker/modules/validators.rb
alex_codebreaker-0.1.9 lib/alex_codebreaker/modules/validators.rb
alex_codebreaker-0.1.8 lib/alex_codebreaker/modules/validators.rb
alex_codebreaker-0.1.7 lib/alex_codebreaker/modules/validators.rb