Skip to content

Latest commit

 

History

History
141 lines (97 loc) · 4.48 KB

english_readme.md

File metadata and controls

141 lines (97 loc) · 4.48 KB

Faker::Russian

[по-русски] [developer instructions] Gem Version Build Status Code Climate

Generation of specific russian values

You can use gem 'validates_russian' for validates generated values

Installation

Add to Gemfile

gem 'validates_russian'

Usage

Bik

Generates bank identification number with random okato region number

  Faker::Russian.bik # => '0454954616'

You can pass okato region number

  Faker::Russian.bik(okato_region_number: '40') # => '0440754281'

Also you can use sequences for pseudo-random Bik's

  Faker::Russian.bik(sequence_number: 1) # => '0451491755'
  Faker::Russian.bik(sequence_number: 1) # => '0451491755'

INN

Generate INN with random region number and type (:individual or :legal)

  Faker::Russian.inn # => '183501166447'

You can set region_number and type

  Faker::Russian.inn(region_number: '78') # => '7857296996'
  Faker::Russian.inn(kind: :individual) # => '0229191612'
  Faker::Russian.inn(kind: :legal) # => '366582211439'

Also you can use sequences

  Faker::Russian.inn(sequence_number: 1) # => '0956860593'
  Faker::Russian.inn(sequence_number: 1) # => '0956860593'

OKPO

  Faker::Russian.okpo # => '57972160'

Also pseudo-random sequences available

  Faker::Russian.okpo(sequence_number: 1) # => '13410254'
  Faker::Russian.okpo(sequence_number: 1) # => '13410254'

KPP

Generate KPP with random region_number

  Faker::Russian.kpp # => '525601001'

You can choose region

  Faker::Russian.kpp(region_number: 78) # => '784101001'

Also, you can use pseudo random sequence numbers (not much 1000, there is limited count of kpps)

  Faker::Russian.kpp(sequence_number: 1) # => '381201001'
  Faker::Russian.inn(sequence_number: 1) # => '381201001'

ОКАТО

Generates okato with random okato region number and random length

  Faker::Russian.okato # => '849012471'

You can select okato region number

  Faker::Russian.okato(okato_region_number: 25) # => '251'

You can select okato region length:

  Faker::Russian.okato(length: 3) # => '251'
  Faker::Russian.okato(length: 6) # => '443758'
  Faker::Russian.okato(length: 9) # => '849012471'

You can use sequences

  Faker::Russian.okato(sequence_number: 1) # => '517'
  Faker::Russian.okato(sequence_number: 1) # => '517'

Contributing

Please read CONTRIBUTING.md in Russian