Class: Jfuzz::ObjectGenerator

Inherits:
Generator show all
Defined in:
lib/jfuzz/generators/object_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



18
19
20
# File 'lib/jfuzz/generators/object_generator.rb', line 18

def self.type
  "object"
end

Instance Method Details

#generateObject



7
8
9
10
11
12
13
14
15
16
# File 'lib/jfuzz/generators/object_generator.rb', line 7

def generate
  result = {}
  required_keys = property.fetch("required", [])
  property["properties"].each do |key, value|
    next if skip?(key, required_keys)

    result[key] = property_fuzzer.fuzz_property(value)
  end
  result
end