Class: Synthra::Types::TechnologyInternet::LanguageCode

Inherits:
Base
  • Object
show all
Defined in:
lib/synthra/types/technology_internet/formats.rb

Overview

LanguageCode type

Constant Summary collapse

LANGUAGE_CODES =
["en", "es", "fr", "de", "it", "pt", "ru", "zh", "ja", "ko", "ar", "hi"].freeze

Instance Method Summary collapse

Instance Method Details

#generate_edge(rng, context, args) ⇒ Object



34
35
36
# File 'lib/synthra/types/technology_internet/formats.rb', line 34

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

#generate_invalid(rng, context, args) ⇒ Object



38
39
40
# File 'lib/synthra/types/technology_internet/formats.rb', line 38

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

#generate_random(rng, context, args) ⇒ Object



30
31
32
# File 'lib/synthra/types/technology_internet/formats.rb', line 30

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