Class: NumberPlate::SG::Generator
Constant Summary
Constants included
from Checksum
Checksum::CHECK_SUM, Checksum::MULTIPLIER
Instance Attribute Summary
#country
Instance Method Summary
collapse
Methods included from Checksum
#checksum, #get_checksum_from_numbers, #numbers
Constructor Details
Returns a new instance of Generator.
9
10
11
|
# File 'lib/number_plate/sg/generator.rb', line 9
def initialize
@country = "SG"
end
|
Instance Method Details
#generate ⇒ Object
13
14
15
|
# File 'lib/number_plate/sg/generator.rb', line 13
def generate
letters + numerals + checksum
end
|
#letters ⇒ Object
21
22
23
|
# File 'lib/number_plate/sg/generator.rb', line 21
def letters
@letters = prefix + random_letters
end
|
#numerals ⇒ Object
25
26
27
|
# File 'lib/number_plate/sg/generator.rb', line 25
def numerals
@numerals = rand(1..9999).to_s
end
|
#prefix ⇒ Object
17
18
19
|
# File 'lib/number_plate/sg/generator.rb', line 17
def prefix
'S'
end
|