Class: Synthra::Types::FinanceBanking::MedicareBeneficiaryId
- Defined in:
- lib/synthra/types/finance_banking/identifiers.rb
Overview
MedicareBeneficiaryId type
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
67 68 69 |
# File 'lib/synthra/types/finance_banking/identifiers.rb', line 67 def generate_edge(rng, context, args) ["A" * 11, "0" * 11, "1A2B3C4D5E6"].sample(random: rng.instance_variable_get(:@random)) end |
#generate_invalid(rng, context, args) ⇒ Object
71 72 73 |
# File 'lib/synthra/types/finance_banking/identifiers.rb', line 71 def generate_invalid(rng, context, args) [nil, "too short", [], {}, "too long string here"].sample(random: rng.instance_variable_get(:@random)) end |
#generate_random(rng, context, args) ⇒ Object
61 62 63 64 65 |
# File 'lib/synthra/types/finance_banking/identifiers.rb', line 61 def generate_random(rng, context, args) # Format: 1-2-3-4-5-6-7-8-9-10-11 (11 characters, alphanumeric) chars = ('A'..'Z').to_a + ('0'..'9').to_a 11.times.map { rng.sample(chars) }.join end |