Class: Synthra::Types::TechnologyInternet::AppBundleId

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

Overview

AppBundleId type

Instance Method Summary collapse

Instance Method Details

#generate_edge(rng, context, args) ⇒ Object



18
19
20
# File 'lib/synthra/types/technology_internet/apps.rb', line 18

def generate_edge(rng, context, args)
  ["", "com.a.b", "com.verylongcompanyname.verylongappname"].sample(random: rng.instance_variable_get(:@random))
end

#generate_invalid(rng, context, args) ⇒ Object



22
23
24
# File 'lib/synthra/types/technology_internet/apps.rb', line 22

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

#generate_random(rng, context, args) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/synthra/types/technology_internet/apps.rb', line 8

def generate_random(rng, context, args)
  # Format: com.company.appname
  companies = ["company", "corp", "inc", "llc", "tech", "app", "mobile", "digital"]
  apps = ["app", "application", "mobile", "ios", "android", "game", "tool", "utility"]
  company = rng.sample(companies)
  app = rng.sample(apps)
  number = rng.int(1, 999)
  "com.#{company}.#{app}#{number}"
end