class Faker::Demographic

def demonym

Returns:
  • (String) -
def demonym
  fetch('demographic.demonym')
end

def educational_attainment

Returns:
  • (String) -
def educational_attainment
  fetch('demographic.educational_attainment')
end

def height(unit: :metric)

Returns:
  • (String) -

Parameters:
  • unit (Symbol) -- either `:metric` or `imperial`.
def height(unit: :metric)
  case unit
  when :imperial
    inches = rand_in_range(57, 86)
    "#{inches / 12} ft, #{inches % 12} in"
  when :metric
    rand_in_range(1.45, 2.13).round(2).to_s
  end
end

def marital_status

Returns:
  • (String) -
def marital_status
  fetch('demographic.marital_status')
end

def race

Returns:
  • (String) -
def race
  fetch('demographic.race')
end

def sex

Returns:
  • (String) -
def sex
  fetch('demographic.sex')
end