Class: Synthra::Types::TextContent::Race

Inherits:
Base
  • Object
show all
Defined in:
lib/synthra/types/text_content/misc.rb

Overview

Race type

Constant Summary collapse

RACES =
[
  "White", "Black or African American", "Asian", "American Indian or Alaska Native",
  "Native Hawaiian or Other Pacific Islander", "Other", "Prefer not to say"
].freeze

Instance Method Summary collapse

Instance Method Details

#generate_edge(rng, context, args) ⇒ Object



187
188
189
# File 'lib/synthra/types/text_content/misc.rb', line 187

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

#generate_invalid(rng, context, args) ⇒ Object



191
192
193
# File 'lib/synthra/types/text_content/misc.rb', line 191

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

#generate_random(rng, context, args) ⇒ Object



183
184
185
# File 'lib/synthra/types/text_content/misc.rb', line 183

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