Class: Faker::Boolean
Constant Summary
Constants inherited from Base
Faker::Base::LLetters, Faker::Base::Letters, Faker::Base::NOT_GIVEN, Faker::Base::Numbers, Faker::Base::ULetters
Class Method Summary collapse
-
.boolean(true_ratio: 0.5) ⇒ Boolean
Produces a boolean.
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
.boolean(true_ratio: 0.5) ⇒ Boolean
Produces a boolean
18 19 20 |
# File 'lib/faker/default/boolean.rb', line 18 def boolean(true_ratio: 0.5) (rand < true_ratio) end |