class Faker::Boolean

def boolean(legacy_true_ratio = NOT_GIVEN, true_ratio: 0.5)

Returns:
  • (Boolean) -

Parameters:
  • true_ratio (Float) -- The likelihood (as a float, out of 1.0) for the method to return `true`.
def boolean(legacy_true_ratio = NOT_GIVEN, true_ratio: 0.5)
  warn_for_deprecated_arguments do |keywords|
    keywords << :true_ratio if legacy_true_ratio != NOT_GIVEN
  end
  (rand < true_ratio)
end