Class: Forgery::RussianTax

Inherits:
Forgery
  • Object
show all
Defined in:
lib/forgery/forgery/russian_tax.rb

Overview

Generates various special numbers for Russian taxation system They have numbers for identification, for banks, for companies and entrepreneurs

Constant Summary collapse

TYPES =
Forgery::Extend([:person, :legal])

Constants inherited from Forgery

VERSION

Class Method Summary collapse

Methods inherited from Forgery

Extend, dictionaries, formats, load_from!, load_paths, rails?, rails_root

Class Method Details

.account_numberObject

bank account format pretty simple


13
14
15
# File 'lib/forgery/forgery/russian_tax.rb', line 13

def self.
  20.times.map { rand(9) + 1 }.join
end

.bikObject

bank identification


8
9
10
# File 'lib/forgery/forgery/russian_tax.rb', line 8

def self.bik
  "04#{5.times.map { rand(9) + 1 }.join}#{rand(50) + 50}"
end

.inn(options = {}) ⇒ Object

taxation id


18
19
20
21
# File 'lib/forgery/forgery/russian_tax.rb', line 18

def self.inn(options = {})
  type = TYPES.include?(options[:type]) ? options[:type] : TYPES.random
  send [type, :inn].join('_')
end

.ogrn(options = {}) ⇒ Object

government registration id


24
25
26
27
# File 'lib/forgery/forgery/russian_tax.rb', line 24

def self.ogrn(options = {})
  type = TYPES.include?(options[:type]) ? options[:type] : TYPES.random
  send [type, :ogrn].join('_')
end