bancos_brasileiros 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BancosBrasileiros
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
@@ -1,8 +1,37 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'json'
3
4
  require_relative "bancos_brasileiros/version"
4
5
 
5
6
  module BancosBrasileiros
6
- class Error < StandardError; end
7
- # Your code goes here...
7
+ class << self
8
+ def load_data
9
+ file_path = File.expand_path('../../data/bancos.json', __FILE__)
10
+ JSON.parse(File.read(file_path))
11
+ end
12
+
13
+ def all_banks
14
+ load_data
15
+ end
16
+
17
+ def find_bank_by_codigo_compe(compe)
18
+ all_banks.find { |bank| bank["COMPE"] == compe }
19
+ end
20
+
21
+ def find_bank_by_ispb(ispb)
22
+ all_banks.find { |bank| bank["ISPB"] == ispb }
23
+ end
24
+
25
+ def find_banks_by_network(network)
26
+ all_banks.select { |bank| bank["Network"] == network }
27
+ end
28
+
29
+ def find_banks_by_type(bank_type)
30
+ all_banks.select { |bank| bank["Type"] == bank_type }
31
+ end
32
+
33
+ def find_banks_by_pix_type(pix_type)
34
+ all_banks.select { |bank| bank["PixType"] == pix_type }
35
+ end
36
+ end
8
37
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bancos_brasileiros
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elton Santos
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-07 00:00:00.000000000 Z
11
+ date: 2024-07-22 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: "\U0001F1E7\U0001F1F7 \U0001F3E6 \U0001F4CB Brazilian commercial banks
14
14
  list"
@@ -22,7 +22,9 @@ files:
22
22
  - MIT-LICENSE.md
23
23
  - README.md
24
24
  - Rakefile
25
+ - bancos_brasileiros-0.1.0.gem
25
26
  - bancos_brasileiros.gemspec
27
+ - data/bancos.json
26
28
  - lib/bancos_brasileiros.rb
27
29
  - lib/bancos_brasileiros/version.rb
28
30
  - sig/bancos_brasileiros.rbs