lib/jan/random.rb in jan-0.0.3 vs lib/jan/random.rb in jan-0.0.4

- old
+ new

@@ -1,19 +1,19 @@ require "jan/parser" require "jan/check_digit_calculator" -class Jan +class Jan < ::String module Random module_function Digits = %w(1 2 3 4 5 6 7 8 9 0) def code(size=13) build(size) end def instore_code(size=13) - build(size - 2, InstorePrefixes.sample) + build(size - 2, InstoreCodePrefixes.sample) end def build(size, code="") size.times{ code += Digits.sample } Parser.body(code) + CheckDigitCalculator.calculate(Parser.body(code)).to_s