Class: Jfuzz::ArrayGenerator

Inherits:
Generator show all
Defined in:
lib/jfuzz/generators/array_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Generator

#initialize, #try_generate

Constructor Details

This class inherits a constructor from Jfuzz::Generator

Class Method Details

.typeObject



14
15
16
# File 'lib/jfuzz/generators/array_generator.rb', line 14

def self.type
  "array"
end

Instance Method Details

#generateObject



7
8
9
10
11
12
# File 'lib/jfuzz/generators/array_generator.rb', line 7

def generate
  raise "Cannot generate an empty array. Please specify item types" unless items.any?

  return tuple_array if items.is_a?(Array)
  random_array
end