lib/faker/default/company.rb
# Get a random Polish register of national economy number. More info https://pl.wikipedia.org/wiki/REGON
Get a random Polish register of national economy number.
Get a random Polish register of national economy number .
def polish_register_of_national_economy(length = 9)
        raise ArgumentError, 'Length should be 9 or 14' unless [9, 14].include? length
        random_digits = []
        loop do
          random_digits = Array.new(length) { rand(10) }
          break if collect_regon_sum(random_digits) == random_digits.last
        end
        random_digits.join('')
      end
def polish_register_of_national_economy ( length = 9 ) raise ArgumentError , 'Length should be 9 or 14' unless [ 9 , 14 ] . include? length random_digits = [ ] loop do random_digits = Array . new ( length ) { rand ( 10 ) } break if collect_regon_sum ( random_digits ) == random_digits . last end random_digits . join ( '' ) end
Get a random Polish register of national economy number.
Get a random Polish register of national economy number .
length
<not_specific>