module Codebreaker module Helpers module Validator FORMAT_VALUES = /^[1-6]{4}$/.freeze def empty_check?(value) value.chomp.empty? end def format_check?(value) value =~ FORMAT_VALUES end def size_check(value, min_size, max_size) value.chomp.size.between?(min_size, max_size) end end end end