Sha256: 89be053f6d53b34a9a42932c3d6bd4b64340b3f90e17ae10bb66a38888d79a6f

Contents?: true

Size: 313 Bytes

Versions: 1

Compression:

Stored size: 313 Bytes

Contents

module JsonTestData
  class String
    class << self
      def create(schema)
        return schema.fetch(:enum).sample if schema.fetch(:enum, nil)

        len = schema.fetch(:maxLength, nil) || schema.fetch(:minLength, nil) || 1
        RegXing::Generator.new(/.{#{len}}/).generate!
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
json_test_data-0.8.0 lib/json_test_data/data_structures/string.rb