Class: ElfproefPlan::ElfProef
- Inherits:
-
Object
- Object
- ElfproefPlan::ElfProef
- Defined in:
- lib/elfproef_plan.rb
Instance Attribute Summary collapse
-
#nr ⇒ Object
Returns the value of attribute nr.
-
#nrs ⇒ Object
Returns the value of attribute nrs.
Instance Method Summary collapse
-
#initialize(nr) ⇒ ElfProef
constructor
A new instance of ElfProef.
- #validBsn ⇒ Object
- #validRekening ⇒ Object
Constructor Details
#initialize(nr) ⇒ ElfProef
20 21 22 23 |
# File 'lib/elfproef_plan.rb', line 20 def initialize(nr) @nr = nr.to_s.scan(/[\d+$]/).map{|x| x.to_i} @nrs = (2..9).to_a.reverse end |
Instance Attribute Details
#nr ⇒ Object
Returns the value of attribute nr.
18 19 20 |
# File 'lib/elfproef_plan.rb', line 18 def nr @nr end |
#nrs ⇒ Object
Returns the value of attribute nrs.
18 19 20 |
# File 'lib/elfproef_plan.rb', line 18 def nrs @nrs end |
Instance Method Details
#validBsn ⇒ Object
31 32 33 34 35 36 |
# File 'lib/elfproef_plan.rb', line 31 def validBsn return false if @nr.length > 9 @nr.unshift 0 while @nr.length < 9 return false if @nr[0,3].sum < 1 elfproef(-1) end |
#validRekening ⇒ Object
25 26 27 28 29 |
# File 'lib/elfproef_plan.rb', line 25 def validRekening return false unless [9, 10].include? @nr.length nrs.unshift 10 if @nr.length == 10 elfproef(1) end |