brval 0.9.6 → 0.9.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 59e704af5376f8ed92bafd6283b3da2d45fc49b7aad86c4fe366c09479675a6d
4
- data.tar.gz: 8d1e625304222e11c7c8d45076a2c964b8c8ae6cf384f1df7b0fbd00f21b34ef
3
+ metadata.gz: efd3d17fa1e73e7c5f5bac6fa8d61d4c990e3a2d964ee10c70f815fa083c2d6c
4
+ data.tar.gz: e039bccd9ae6f70062d2a2b35a51dac000f9c0268d2a7ff45deaaf7fc4e8cbf1
5
5
  SHA512:
6
- metadata.gz: 96e7b060477730981e7c8e18c3a15bd632b15d40ab95e9dc24657eb19e8cca38d0a09ca5ccc73a12fceaeaa49d8b1d853248c48a572e94b0b4674c32db43e808
7
- data.tar.gz: fd29d8f868870ccaf9f50646d60a71aac19be2865bc16fcdad00f47cabb2f813895a6274fdf3c499db9c023d43432632bebb6283f49559ea6d2c9fd4cebd7270
6
+ metadata.gz: f9240805a602e239bf84897b6fdaed46932137055cc1d01c58a6419d377535466937cd339f77679592d966a75cec8573fbe902604aca14c477f13856ff8c7410
7
+ data.tar.gz: 2f59e7d5e97e138549090c3e571f2d6ef755e02ee364005966943ae199c9d2933393fddb89693aff23b4ff8eb536feef2d7478402fe32c30b0df2f2bf8bc8680
data/lib/brval/cnpj.rb CHANGED
@@ -1,6 +1,11 @@
1
1
  module Brval
2
2
  class Cnpj < Val
3
3
 
4
+ def mask
5
+ code_mask = super
6
+ code_mask.insert(2, '.').insert(6, '.').insert(10, '/').insert(15, '-')
7
+ end
8
+
4
9
  private
5
10
 
6
11
  NULLS = %w{11111111111111 22222222222222 33333333333333 44444444444444 55555555555555 66666666666666 77777777777777 88888888888888 99999999999999 00000000000000}.freeze
@@ -7,5 +7,9 @@ module Brval
7
7
  Cnpj.new(cnpj).valid?
8
8
  end
9
9
 
10
+ def cnpj_mask cnpj
11
+ Cnpj.new(cnpj).mask
12
+ end
13
+
10
14
  end
11
15
  end
data/lib/brval/cpf.rb CHANGED
@@ -1,6 +1,11 @@
1
1
  module Brval
2
2
  class Cpf < Val
3
3
 
4
+ def mask
5
+ code_mask = super
6
+ code_mask.insert(3, '.').insert(7, '.').insert(11, '-')
7
+ end
8
+
4
9
  private
5
10
 
6
11
  NULLS = %w{12345678909 11111111111 22222222222 33333333333 44444444444 55555555555 66666666666 77777777777 88888888888 99999999999 00000000000 01234567890}.freeze
@@ -7,5 +7,9 @@ module Brval
7
7
  Cpf.new(cpf).valid?
8
8
  end
9
9
 
10
+ def cpf_mask cpf
11
+ Cpf.new(cpf).mask
12
+ end
13
+
10
14
  end
11
15
  end
data/lib/brval/val.rb CHANGED
@@ -8,6 +8,10 @@ module Brval
8
8
  @code = code.tr('^0-9', '')
9
9
  end
10
10
 
11
+ def mask
12
+ code_mask = @code.dup
13
+ end
14
+
11
15
  def valid?
12
16
  validate_code
13
17
  end
data/lib/brval/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Brval
2
- VERSION = "0.9.6"
2
+ VERSION = "0.9.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brval
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.6
4
+ version: 0.9.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lucas Andrade
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-01-24 00:00:00.000000000 Z
11
+ date: 2019-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler