Skip to content

Instantly share code, notes, and snippets.

@jamiecook
Last active August 29, 2015 14:17
Show Gist options
  • Save jamiecook/a2512c58d013df7c8dec to your computer and use it in GitHub Desktop.
Save jamiecook/a2512c58d013df7c8dec to your computer and use it in GitHub Desktop.
# Note that if any data required to determine the type of person is missing then person type = :missing
if [study_type, employment_status, other_activity].all? { |e| e == :missing }
:missing
elsif study_type == :primary_school
:primary_school
elsif study_type == :secondary_school
:secondary_school
elsif employment_status == :full_time
if study_type == :no_study || study_type == :missing
white_or_blue == :white ? :full_time_white_collar_worker : :full_time_blue_collar_worker
else
white_or_blue == :white ? :full_time_white_worker_and_any_tertiary : :full_time_blue_worker_and_any_tertiary
end
elsif employment_status == :part_time_or_casual
if study_type == :no_study || study_type == :missing
white_or_blue == :white ? :part_time_white_collar_worker : :part_time_blue_collar_worker
else
white_or_blue == :white ? :part_time_white_worker_and_any_tertiary : :part_time_blue_worker_and_any_tertiary
end
elsif study_type == :full_time_tertiary
:full_time_tertiary
elsif [:part_time_tertiary, :other_study].include?(study_type)
:part_time_tertiary
elsif [:not_yet_at_school, :unemployed, :home_duties, :retired].include?(other_activity)
other_activity
else
:other
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment