Class: Faker::Gender

Inherits:
Base
  • Object
show all
Defined in:
lib/faker/default/gender.rb

Constant Summary

Constants inherited from Base

Base::LLetters, Base::Letters, Base::NOT_GIVEN, Base::Numbers, Base::ULetters

Class Method Summary collapse

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

.binary_typeString

Produces either ‘Male’ or ‘Female’.

Examples:

Faker::Gender.binary_type #=> "Female"

Returns:

  • (String)

Available since:

  • 1.9.0



28
29
30
# File 'lib/faker/default/gender.rb', line 28

def binary_type
  fetch('gender.binary_types')
end

.short_binary_typeString

Produces either ‘f’ or ‘m’.

Examples:

Faker::Gender.short_binary_type #=> "f"

Returns:

  • (String)

Available since:

  • 2.13.0



41
42
43
# File 'lib/faker/default/gender.rb', line 41

def short_binary_type
  fetch('gender.short_binary_types')
end

.typeString

Produces the name of a gender identity.

Examples:

Faker::Gender.type #=> "Non-binary"

Returns:

  • (String)

Available since:

  • 1.9.0



15
16
17
# File 'lib/faker/default/gender.rb', line 15

def type
  fetch('gender.types')
end