Class: Synthra::Types::PersonalNames::GenderAbbrev

Inherits:
Base
  • Object
show all
Defined in:
lib/synthra/types/personal_names/identifiers.rb

Overview

GenderAbbrev type

Constant Summary collapse

ABBREVS =
["M", "F", "NB", "O"].freeze

Instance Method Summary collapse

Instance Method Details

#generate_edge(rng, context, args) ⇒ Object



141
142
143
# File 'lib/synthra/types/personal_names/identifiers.rb', line 141

def generate_edge(rng, context, args)
  ["", "M", "F"].sample(random: rng.instance_variable_get(:@random))
end

#generate_invalid(rng, context, args) ⇒ Object



145
146
147
# File 'lib/synthra/types/personal_names/identifiers.rb', line 145

def generate_invalid(rng, context, args)
  [nil, 123, [], {}].sample(random: rng.instance_variable_get(:@random))
end

#generate_random(rng, context, args) ⇒ Object



137
138
139
# File 'lib/synthra/types/personal_names/identifiers.rb', line 137

def generate_random(rng, context, args)
  rng.sample(ABBREVS)
end