Class: Ronin::Fuzzing::Repeater
- Inherits:
-
Object
- Object
- Ronin::Fuzzing::Repeater
- Defined in:
- lib/ronin/fuzzing/repeater.rb
Overview
Fuzzing class that generates repeated data.
Instance Attribute Summary collapse
-
#lengths ⇒ Object
readonly
The lengths to repeat the data by.
Instance Method Summary collapse
-
#each(repeatable) {|repeated| ... } ⇒ Enumerator
Enumerates through each length of repeated data.
-
#initialize(lengths) ⇒ Repeater
constructor
Initializes a new Repeater.
Constructor Details
#initialize(lengths) ⇒ Repeater
Initializes a new Repeater.
43 44 45 46 47 48 49 50 51 52 |
# File 'lib/ronin/fuzzing/repeater.rb', line 43 def initialize(lengths) @lengths = case lengths when Integer [lengths] when Enumerable lengths else raise(TypeError,"argument must be Enumerable or an Integer") end end |
Instance Attribute Details
#lengths ⇒ Object (readonly)
The lengths to repeat the data by
32 33 34 |
# File 'lib/ronin/fuzzing/repeater.rb', line 32 def lengths @lengths end |
Instance Method Details
#each(repeatable) {|repeated| ... } ⇒ Enumerator
Enumerates through each length of repeated data.
69 70 71 72 73 74 75 76 77 |
# File 'lib/ronin/fuzzing/repeater.rb', line 69 def each(repeatable) return enum_for(__method__,repeatable) unless block_given? @lengths.each do |length| yield(repeatable * length) end return nil end |