brval 0.9.7 → 0.9.72

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: efd3d17fa1e73e7c5f5bac6fa8d61d4c990e3a2d964ee10c70f815fa083c2d6c
4
- data.tar.gz: e039bccd9ae6f70062d2a2b35a51dac000f9c0268d2a7ff45deaaf7fc4e8cbf1
3
+ metadata.gz: 19e4c0bbb0c91870d0b8efc04954b0fa09acf852d01a25ca760c6fbae4967013
4
+ data.tar.gz: 4955a027ec6f387156190f4e202dcfb539c2f093abbbeba7a5e12a711591be7a
5
5
  SHA512:
6
- metadata.gz: f9240805a602e239bf84897b6fdaed46932137055cc1d01c58a6419d377535466937cd339f77679592d966a75cec8573fbe902604aca14c477f13856ff8c7410
7
- data.tar.gz: 2f59e7d5e97e138549090c3e571f2d6ef755e02ee364005966943ae199c9d2933393fddb89693aff23b4ff8eb536feef2d7478402fe32c30b0df2f2bf8bc8680
6
+ metadata.gz: 4acea2d11f7e8755ac4948d85cdbfc959006434de912f29edc405885b6f29f296cbdcba88eb7c86a17681e1348198dfcd852d41fae98cc7bd47ed9ce7b2cb374
7
+ data.tar.gz: 1f0650d34ad6aeec58070f5cfdc758edfbc01b226a375c56854acad9b5333935398eddeea23282e7361994bb704fe0eba01f7cba23eba1938fcf6d9c4e8a8ffd
data/README.md CHANGED
@@ -51,7 +51,9 @@ Above is the list with all the functions and validations avaible on Brval gem.
51
51
  | Brval.cep_info? |json | Json with cep information |
52
52
  | Brval.cnh_valid? |true/false | |
53
53
  | Brval.cnpj_valid? |true/false | |
54
+ | Brval.cnpj_mask |CNPJ com máscara| retorna o CNPJ com máscara: 00.000.000/0000-00 |
54
55
  | Brval.cpf_valid? |true/false | |
56
+ | Brval.cpf_mask |CPF com máscara| retorna o CPF com máscara: 000.000.000-00 |
55
57
  | Brval.credit_card_valid?|true/false | Number of credit card with 16 digits |
56
58
  | Brval.lawsuit_valid? |true/false | Number of judicial process|
57
59
  | Brval.pis_valid? |true/false | Same validation for: PIS/PASEP/NIT |
@@ -1,9 +1,8 @@
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, '-')
4
+ def masked
5
+ @code.dup.insert(2, '.').insert(6, '.').insert(10, '/').insert(15, '-')
7
6
  end
8
7
 
9
8
  private
@@ -1,9 +1,8 @@
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, '-')
4
+ def masked
5
+ @code.dup.insert(3, '.').insert(7, '.').insert(11, '-')
7
6
  end
8
7
 
9
8
  private
@@ -4,17 +4,19 @@ module Brval
4
4
  attr_accessor :code
5
5
 
6
6
  def initialize(code)
7
- raise ArgumentError, 'The br code informed is nil' if code.nil?
7
+ return if code.nil?
8
8
  @code = code.tr('^0-9', '')
9
9
  end
10
10
 
11
11
  def mask
12
- code_mask = @code.dup
12
+ return if @code.nil?
13
+ masked
13
14
  end
14
15
 
15
16
  def valid?
17
+ return false if @code.nil?
16
18
  validate_code
17
19
  end
18
20
 
19
21
  end
20
- end
22
+ end
@@ -1,3 +1,3 @@
1
1
  module Brval
2
- VERSION = "0.9.7"
2
+ VERSION = "0.9.72"
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.7
4
+ version: 0.9.72
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-25 00:00:00.000000000 Z
11
+ date: 2019-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -48,22 +48,22 @@ dependencies:
48
48
  name: rspec
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - "~>"
52
- - !ruby/object:Gem::Version
53
- version: '3.8'
54
51
  - - ">="
55
52
  - !ruby/object:Gem::Version
56
53
  version: 3.8.0
54
+ - - "~>"
55
+ - !ruby/object:Gem::Version
56
+ version: '3.8'
57
57
  type: :development
58
58
  prerelease: false
59
59
  version_requirements: !ruby/object:Gem::Requirement
60
60
  requirements:
61
- - - "~>"
62
- - !ruby/object:Gem::Version
63
- version: '3.8'
64
61
  - - ">="
65
62
  - !ruby/object:Gem::Version
66
63
  version: 3.8.0
64
+ - - "~>"
65
+ - !ruby/object:Gem::Version
66
+ version: '3.8'
67
67
  - !ruby/object:Gem::Dependency
68
68
  name: simplecov
69
69
  requirement: !ruby/object:Gem::Requirement
@@ -186,7 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
186
186
  version: '0'
187
187
  requirements: []
188
188
  rubyforge_project:
189
- rubygems_version: 2.7.6
189
+ rubygems_version: 2.7.8
190
190
  signing_key:
191
191
  specification_version: 4
192
192
  summary: Gem to validates many Brazilian codes