Class: Synthra::Types::TechnologyInternet::TopLevelDomain
- Defined in:
- lib/synthra/types/technology_internet/formats.rb
Overview
TopLevelDomain type
Constant Summary collapse
- TLDS =
[".com", ".org", ".net", ".edu", ".gov", ".io", ".co", ".ai", ".dev", ".app"].freeze
Instance Method Summary collapse
- #generate_edge(rng, context, args) ⇒ Object
- #generate_invalid(rng, context, args) ⇒ Object
- #generate_random(rng, context, args) ⇒ Object
Instance Method Details
#generate_edge(rng, context, args) ⇒ Object
73 74 75 |
# File 'lib/synthra/types/technology_internet/formats.rb', line 73 def generate_edge(rng, context, args) ["", ".com", ".xxx"].sample(random: rng.instance_variable_get(:@random)) end |
#generate_invalid(rng, context, args) ⇒ Object
77 78 79 |
# File 'lib/synthra/types/technology_internet/formats.rb', line 77 def generate_invalid(rng, context, args) [nil, 123, [], {}].sample(random: rng.instance_variable_get(:@random)) end |
#generate_random(rng, context, args) ⇒ Object
69 70 71 |
# File 'lib/synthra/types/technology_internet/formats.rb', line 69 def generate_random(rng, context, args) rng.sample(TLDS) end |