Class: Watobo::FuzzGenerator
- Inherits:
-
Object
- Object
- Watobo::FuzzGenerator
- Defined in:
- lib/watobo/core/fuzz_gen.rb
Overview
base class for generators
Direct Known Subclasses
Instance Attribute Summary collapse
-
#actions ⇒ Object
readonly
Returns the value of attribute actions.
-
#genType ⇒ Object
readonly
Returns the value of attribute genType.
-
#info ⇒ Object
readonly
Returns the value of attribute info.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#numRequests ⇒ Object
readonly
Returns the value of attribute numRequests.
Instance Method Summary collapse
- #addAction(proc) ⇒ Object
- #generate ⇒ Object
-
#initialize(fuzzer_tag) ⇒ FuzzGenerator
constructor
A new instance of FuzzGenerator.
- #is_generator? ⇒ Boolean
- #removeAction(action) ⇒ Object
- #run(imr = nil) ⇒ Object
Constructor Details
#initialize(fuzzer_tag) ⇒ FuzzGenerator
Returns a new instance of FuzzGenerator.
44 45 46 47 48 49 50 |
# File 'lib/watobo/core/fuzz_gen.rb', line 44 def initialize(fuzzer_tag) @actions = [] @numRequests = 0 @fuzzer_tag = fuzzer_tag @genType = "Undefined" @info = "undefined" end |
Instance Attribute Details
#actions ⇒ Object (readonly)
Returns the value of attribute actions.
9 10 11 |
# File 'lib/watobo/core/fuzz_gen.rb', line 9 def actions @actions end |
#genType ⇒ Object (readonly)
Returns the value of attribute genType.
8 9 10 |
# File 'lib/watobo/core/fuzz_gen.rb', line 8 def genType @genType end |
#info ⇒ Object (readonly)
Returns the value of attribute info.
10 11 12 |
# File 'lib/watobo/core/fuzz_gen.rb', line 10 def info @info end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/watobo/core/fuzz_gen.rb', line 7 def name @name end |
#numRequests ⇒ Object (readonly)
Returns the value of attribute numRequests.
6 7 8 |
# File 'lib/watobo/core/fuzz_gen.rb', line 6 def numRequests @numRequests end |
Instance Method Details
#addAction(proc) ⇒ Object
32 33 34 |
# File 'lib/watobo/core/fuzz_gen.rb', line 32 def addAction(proc) @actions.push proc end |
#generate ⇒ Object
40 41 42 |
# File 'lib/watobo/core/fuzz_gen.rb', line 40 def generate return true end |
#is_generator? ⇒ Boolean
12 13 14 |
# File 'lib/watobo/core/fuzz_gen.rb', line 12 def is_generator? true end |
#removeAction(action) ⇒ Object
36 37 38 |
# File 'lib/watobo/core/fuzz_gen.rb', line 36 def removeAction(action) @actions.delete(action) end |
#run(imr = nil) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/watobo/core/fuzz_gen.rb', line 16 def run(imr=nil) result = Hash.new result.update imr if imr generate do |value| rv = value @actions.each do |p| rv = p.func.call(rv) end result[@fuzzer_tag.name] = rv yield result end end |