lib/meibo/demographic.rb in meibo-0.16.0 vs lib/meibo/demographic.rb in meibo-0.17.0
- old
+ new
@@ -1,54 +1,55 @@
# frozen_string_literal: true
module Meibo
class Demographic
SEX = {
- male: 'male',
- female: 'female',
- unspecified: 'unspecified',
- other: 'other'
+ male: "male",
+ female: "female",
+ unspecified: "unspecified",
+ other: "other"
}.freeze
DataModel.define(
self,
attribute_name_to_header_field_map: {
- sourced_id: 'sourcedId',
- status: 'status',
- date_last_modified: 'dateLastModified',
- birth_date: 'birthDate',
- sex: 'sex',
- american_indian_or_alaska_native: 'americanIndianOrAlaskaNative',
- asian: 'asian',
- black_or_african_american: 'blackOrAfricanAmerican',
- native_hawaiian_or_other_pacific_islander: 'nativeHawaiianOrOtherPacificIslander',
- white: 'white',
- demographic_race_two_or_more_races: 'demographicRaceTwoOrMoreRaces',
- hispanic_or_latino_ethnicity: 'hispanicOrLatinoEthnicity',
- country_of_birth_code: 'countryOfBirthCode',
- state_of_birth_abbreviation: 'stateOfBirthAbbreviation',
- city_of_birth: 'cityOfBirth',
- public_school_residence_status: 'publicSchoolResidenceStatus'
+ sourced_id: "sourcedId",
+ status: "status",
+ date_last_modified: "dateLastModified",
+ birth_date: "birthDate",
+ sex: "sex",
+ american_indian_or_alaska_native: "americanIndianOrAlaskaNative",
+ asian: "asian",
+ black_or_african_american: "blackOrAfricanAmerican",
+ native_hawaiian_or_other_pacific_islander: "nativeHawaiianOrOtherPacificIslander",
+ white: "white",
+ demographic_race_two_or_more_races: "demographicRaceTwoOrMoreRaces",
+ hispanic_or_latino_ethnicity: "hispanicOrLatinoEthnicity",
+ country_of_birth_code: "countryOfBirthCode",
+ state_of_birth_abbreviation: "stateOfBirthAbbreviation",
+ city_of_birth: "cityOfBirth",
+ public_school_residence_status: "publicSchoolResidenceStatus"
}.freeze,
converters: {
- boolean: [
- :american_indian_or_alaska_native,
- :asian,
- :black_or_african_american,
- :native_hawaiian_or_other_pacific_islander,
- :white,
- :demographic_race_two_or_more_races,
- :hispanic_or_latino_ethnicity
+ boolean: %i[
+ american_indian_or_alaska_native
+ asian
+ black_or_african_american
+ native_hawaiian_or_other_pacific_islander
+ white
+ demographic_race_two_or_more_races
+ hispanic_or_latino_ethnicity
].freeze,
date: [:birth_date].freeze,
datetime: [:date_last_modified].freeze,
enum: { sex: [*SEX.values, ENUM_EXT_PATTERN].freeze }.freeze,
required: [:sourced_id].freeze,
status: [:status].freeze
}
)
- def initialize(sourced_id:, status: nil, date_last_modified: nil, birth_date: nil, sex: nil, american_indian_or_alaska_native: nil, asian: nil, black_or_african_american: nil, native_hawaiian_or_other_pacific_islander: nil, white: nil, demographic_race_two_or_more_races: nil, hispanic_or_latino_ethnicity: nil, country_of_birth_code: nil, state_of_birth_abbreviation: nil, city_of_birth: nil, public_school_residence_status: nil, **extension_fields)
+ def initialize(sourced_id:, status: nil, date_last_modified: nil, birth_date: nil, sex: nil,
+ american_indian_or_alaska_native: nil, asian: nil, black_or_african_american: nil, native_hawaiian_or_other_pacific_islander: nil, white: nil, demographic_race_two_or_more_races: nil, hispanic_or_latino_ethnicity: nil, country_of_birth_code: nil, state_of_birth_abbreviation: nil, city_of_birth: nil, public_school_residence_status: nil, **extension_fields)
@sourced_id = sourced_id
@status = status
@date_last_modified = date_last_modified
@birth_date = birth_date
@sex = sex