Class: Jfuzz::StringGenerator
Constant Summary
collapse
- DATE =
"date"
- DATE_TIME =
"date-time"
- DATE_REGEXP =
/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/
- TIME_REGEXP =
/\A(\d{2}):(\d{2}):(\d{2})\z/
- DATE_TIME_REGEXP =
/^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-2][0-9]:[0-5][0-9]:[0-5][0-9](\.[0-9]+)?(Z|[\-+][0-9]{2}:[0-5][0-9])$/
- FORMATS =
{
DATE => DATE_REGEXP,
DATE_TIME => DATE_TIME_REGEXP,
}.freeze
- CHARSET =
Array("A".."Z") + Array("a".."z") + Array(0..9)
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Generator
#initialize, #try_generate
Class Method Details
.type ⇒ Object
33
34
35
|
# File 'lib/jfuzz/generators/string_generator.rb', line 33
def self.type
"string"
end
|
Instance Method Details
#generate ⇒ Object
23
24
25
26
27
28
29
30
31
|
# File 'lib/jfuzz/generators/string_generator.rb', line 23
def generate
if format?
return generate_from_format
elsif pattern?
return generate_from_pattern
end
generate_string
end
|