Module: NameBank::PoolSchema
- Defined in:
- lib/name_bank/pool_schema.rb
Overview
The pool-key schema: the base YAML keys, how native-script keys are named, and how a gender maps to its key. Shared by the runtime NameBank and the build-time SplitScripts tool so the key names live in one place.
Constant Summary collapse
- GIVEN_MALE =
"firstnames_male"- GIVEN_FEMALE =
"firstnames_female"- SURNAMES =
"lastnames"- KEYS =
[GIVEN_MALE, GIVEN_FEMALE, SURNAMES].freeze
Class Method Summary collapse
Class Method Details
.gender_key(gender) ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/name_bank/pool_schema.rb', line 23 def gender_key(gender) case gender when :male then GIVEN_MALE when :female then GIVEN_FEMALE else raise UnknownGender, "gender must be :male or :female, got #{gender.inspect}" end end |
.native_key(key) ⇒ Object
19 20 21 |
# File 'lib/name_bank/pool_schema.rb', line 19 def native_key(key) "#{key}_native" end |