Class: Faker::VulnerabilityIdentifier
- Defined in:
- lib/faker/default/vulnerability_identifier.rb
Constant Summary
Constants inherited from Base
Base::LLetters, Base::Letters, Base::NOT_GIVEN, Base::Numbers, Base::ULetters
Class Method Summary collapse
-
.cve(year: ::Date.today.year) ⇒ String
Produces a Common Vulnerabilities and Exposures (CVE) identifier.
Methods inherited from Base
bothify, disable_enforce_available_locales, fetch, fetch_all, flexible, generate, letterify, method_missing, numerify, parse, rand, rand_in_range, regexify, resolve, respond_to_missing?, sample, shuffle, shuffle!, translate, unique, with_locale
Class Method Details
.cve(year: ::Date.today.year) ⇒ String
Produces a Common Vulnerabilities and Exposures (CVE) identifier.
17 18 19 20 |
# File 'lib/faker/default/vulnerability_identifier.rb', line 17 def cve(year: ::Date.today.year) index = rand_in_range(1, 99_999).to_s.rjust(4, '0') "CVE-#{year}-#{index}" end |