Class: Faker::Blood

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

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

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, translate, unique, with_locale

Class Method Details

.groupString

Produces a random blood group name.

Examples:

Faker::Blood.group #=> "AB-"

Returns:

  • (String)

Available since:

  • 2.13.0



43
44
45
# File 'lib/faker/default/blood.rb', line 43

def group
  parse('blood.group')
end

.rh_factorString

Produces a random blood RH-Factor.

Examples:

Faker::Blood.rh_factor #=> "-"

Returns:

  • (String)

Available since:

  • 2.13.0



30
31
32
# File 'lib/faker/default/blood.rb', line 30

def rh_factor
  fetch('blood.rh_factor')
end

.typeString

Produces a random blood type.

Examples:

Faker::Blood.type #=> "AB"

Returns:

  • (String)

Available since:

  • 2.13.0



17
18
19
# File 'lib/faker/default/blood.rb', line 17

def type
  fetch('blood.type')
end