lib/rfauxfactory.rb
def gen_strings(length = 10, exclude: [])
      positive_int_or_range! length
      raise TypeError, 'exclude must be an Array' unless exclude.is_a?(Array)
      str_types = RFauxFactory::STRING_TYPES.keys.reject { |str_type| exclude.include?(str_type) }
      str_types.map do |str_type|
        str_length = length.is_a?(Range) ? rand(length) : length
        [str_type, gen_string(str_type, str_length)]
      end.to_h
    end
# Generates a list of different input strings.
Generates a list of different input strings.
Generates a list of different input strings .
def gen_strings(length = 10, exclude: [])
      positive_int_or_range! length
      raise TypeError, 'exclude must be an Array' unless exclude.is_a?(Array)
      str_types = RFauxFactory::STRING_TYPES.keys.reject { |str_type| exclude.include?(str_type) }
      str_types.map do |str_type|
        str_length = length.is_a?(Range) ? rand(length) : length
        [str_type, gen_string(str_type, str_length)]
      end.to_h
    end
def gen_strings ( length = 10 , exclude : [ ] ) positive_int_or_range! length raise TypeError , 'exclude must be an Array' unless exclude . is_a? ( Array ) str_types = RFauxFactory :: STRING_TYPES . keys . reject { | str_type | exclude . include? ( str_type ) } str_types . map do | str_type | str_length = length . is_a? ( Range ) ? rand ( length ) : length [ str_type , gen_string ( str_type , str_length ) ] end . to_h end
Generates a list of different input strings.
Generates a list of different input strings .
length
exclude