Class: Synthra::Types::FinanceBanking::BankLei

Inherits:
Base
  • Object
show all
Defined in:
lib/synthra/types/finance_banking/banking.rb

Overview

BankLei type

Instance Method Summary collapse

Instance Method Details

#generate_edge(rng, context, args) ⇒ Object



362
363
364
# File 'lib/synthra/types/finance_banking/banking.rb', line 362

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

#generate_invalid(rng, context, args) ⇒ Object



366
367
368
# File 'lib/synthra/types/finance_banking/banking.rb', line 366

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

#generate_random(rng, context, args) ⇒ Object



356
357
358
359
360
# File 'lib/synthra/types/finance_banking/banking.rb', line 356

def generate_random(rng, context, args)
  # Format: 20 alphanumeric characters
  chars = ('A'..'Z').to_a + ('0'..'9').to_a
  20.times.map { rng.sample(chars) }.join
end