class Faker::Demographic

Public Class Methods

demonym() click to toggle source
# File lib/faker/demographic.rb, line 12
def demonym
  fetch('demographic.demonym')
end
educational_attainment() click to toggle source
# File lib/faker/demographic.rb, line 8
def educational_attainment
  fetch('demographic.educational_attainment')
end
height(unit = :metric) click to toggle source
# File lib/faker/demographic.rb, line 24
def height(unit = :metric)
  case unit
  when :imperial
    inches = rand_in_range(57, 86)
    return "#{inches / 12} ft, #{inches % 12} in"
  when :metric
    return rand_in_range(1.45, 2.13).round(2).to_s
  end
end
marital_status() click to toggle source
# File lib/faker/demographic.rb, line 16
def marital_status
  fetch('demographic.marital_status')
end
race() click to toggle source
# File lib/faker/demographic.rb, line 4
def race
  fetch('demographic.race')
end
sex() click to toggle source
# File lib/faker/demographic.rb, line 20
def sex
  fetch('demographic.sex')
end