bancos_brasileiros 0.1.0 → 0.1.2

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: 753d883296d6bc4b12ef397219f4349b43376cfdb80dd121a7cb639a0880c2c1
4
- data.tar.gz: df8b4170b7359151a318574507a6d03ba8be3204316665a7a50f9d3810d3fea9
3
+ metadata.gz: 96be3635b8df0b4c066e06deee0364c36d6fb61580e3fd0c76a3ecd256a76efe
4
+ data.tar.gz: bb26b0c533c5e983ad3885c8da9764ce2be0892c5fe1c7b4b8b6c2dca87a2f26
5
5
  SHA512:
6
- metadata.gz: 58719dd199e01bc14e85756f2891921ad64da8beb84be7b2f6d4311b9e03c9e0fc6389ebcd57f0a89cb2ada606959f615aeb08f823075a6b0055d4dd74a874f0
7
- data.tar.gz: 7bf37187aab4faac20f8712204b73d3906ab81ab96092b133e0ef542e910751f84de694dc2ab1e8a60804c67a008aac2da91e4cfdc5e15a2ff38a6ef87551bc3
6
+ metadata.gz: f00d5d58211f72a7c39214ee712e190a1ae952f4f24ae414dc8547ae3c7700bfcafaacade678918de3597533a1ff0fb59e78d41d032178d53b64042a11e17e5d
7
+ data.tar.gz: 61c64b8a61db2714e0692b8c89c7f7b82438b556b4b3110a77d115bc08fbcf6197d410202e8e7bc80232f9f9992e896b4683ec0d63588500dd57a344404729fd
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## 0.1.2
2
+
3
+ - Change README
4
+
5
+ ## 0.1.1
6
+
7
+ - Add json with all banks (updated until Jul 13, 2024)
8
+ - Add methods
9
+ - Change README
10
+
1
11
  ## 0.1.0
2
12
 
3
13
  - First release
data/README.md CHANGED
@@ -1,30 +1,83 @@
1
- # BancosBrasileiros
1
+ # Bancos Brasileiros
2
2
 
3
- TODO: Delete this and the text below, and describe your gem
4
-
5
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/bancos_brasileiros`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ 🇧🇷 🏦 📋 Brazilian commercial banks list
6
4
 
7
5
  ## Installation
8
6
 
9
- TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
10
-
11
- Install the gem and add to the application's Gemfile by executing:
12
-
13
- $ bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
14
-
15
- If bundler is not being used to manage dependencies, install the gem by executing:
7
+ Add gem in your Gemfile:
16
8
 
17
- $ gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
9
+ ```ruby
10
+ gem 'bancos_brasileiros'
11
+ ```
12
+ and run **bundle install**
18
13
 
19
14
  ## Usage
20
15
 
21
- TODO: Write usage instructions here
22
-
23
- ## Development
24
-
25
- After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
26
-
27
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
16
+ Example of how to use the `bancos_brasileiros` in a rails project:
17
+
18
+ Create a controller:
19
+
20
+ ```ruby
21
+ # app/controllers/banks_controller.rb
22
+ class BanksController < ApplicationController
23
+ def index
24
+ render json: BancosBrasileiros.all_banks
25
+ end
26
+
27
+ def show
28
+ bank = BancosBrasileiros.find_bank_by_compe(params[:id])
29
+ if bank
30
+ render json: bank
31
+ else
32
+ render json: { error: 'Bank not found.' }, status: :not_found
33
+ end
34
+ end
35
+
36
+ def by_ispb
37
+ bank = BancosBrasileiros.find_bank_by_ispb(params[:ispb])
38
+ if bank
39
+ render json: bank
40
+ else
41
+ render json: { error: 'Bank not found.' }, status: :not_found
42
+ end
43
+ end
44
+
45
+ def by_network
46
+ banks = BancosBrasileiros.find_banks_by_network(params[:network])
47
+ render json: bancos
48
+ end
49
+
50
+ def by_type
51
+ banks = BancosBrasileiros.find_banks_by_type(params[:type])
52
+ render json: banks
53
+ end
54
+
55
+ def by_pix_type
56
+ banks = BancosBrasileiros.find_banks_by_pix_type(params[:pix_type])
57
+ render json: banks
58
+ end
59
+ end
60
+ ```
61
+ Create routes:
62
+
63
+ ```ruby
64
+ # config/routes.rb
65
+ Rails.application.routes.draw do
66
+ resources :banks, only: [:index, :show] do
67
+ collection do
68
+ get 'by_ispb/:ispb', to: 'banks#by_ispb'
69
+ get 'by_network/:network', to: 'banks#by_network'
70
+ get 'by_type/:type', to: 'banks#by_type'
71
+ get 'by_pix_type/:pix_type', to: 'banks#by_pix_type'
72
+ end
73
+ end
74
+ end
75
+ ```
76
+
77
+ ## Requirements
78
+
79
+ - Ruby >= 2.6.0 (recommended 2.7+)
80
+ - Rails >= 6.0 (compatible up to Rails 7)
28
81
 
29
82
  ## Contributing to Bancos Brasileiros
30
83
 
Binary file
Binary file