vpsa 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -0
- data/lib/vpsa/api/provisions.rb +1 -1
- data/lib/vpsa/version.rb +1 -1
- data/spec/vpsa/api/provisions_spec.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3b2f1b422fdf83a67ae33e4adb5500bf89cdab5
|
4
|
+
data.tar.gz: e4acffe7bc8a452f75b642682cc8b97bb19a9f0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a58c951576baafa2b2d8823b955550c7a91da08743d9deda461d35d4b7490abb1a40bc9214a09fc6956eb91576727b1cd27b4c546380f9475ecb518f49db8b1
|
7
|
+
data.tar.gz: 7346a6a8a84d9cba5a216e520aee99da0c3b35a50f7e4ddd4c980302574792c63ec0b5fb342cb16c790cf9e9feb3060effe7742caab6ece786fa4b5e9428c4df
|
data/README.md
CHANGED
@@ -33,6 +33,7 @@ With the client instance, you can access the following resources:
|
|
33
33
|
* Terceiros (client.third_parties) **Listing and finding**
|
34
34
|
* Entidades (client.entities) **Listing and finding**
|
35
35
|
* Lançamentos Padrões (client.default_entries) **Listing and finding**
|
36
|
+
* Provisões (client.provisions) **Only Creation**
|
36
37
|
|
37
38
|
## Using the resources
|
38
39
|
### Listing
|
@@ -55,6 +56,15 @@ It finds the resource with the passed ID.
|
|
55
56
|
Vpsa.new(YOUR_ACCESS_TOKEN).third_parties.find(4)
|
56
57
|
```
|
57
58
|
|
59
|
+
### Creation
|
60
|
+
Some resources implement a **create** method.
|
61
|
+
|
62
|
+
It creates a new resource base on the information passed via Hash.
|
63
|
+
|
64
|
+
```ruby
|
65
|
+
Vpsa.new(YOUR_ACCESS_TOKEN).provisions.create({:"idLancamentoPadrao" => 3, :"idEntidade" => 1, :"idTerceiro" => 15, :"data" => "21-10-2012", :"valor" =>123.40, :"historico" => "histórico da provisão"})
|
66
|
+
```
|
67
|
+
|
58
68
|
### Reading the response
|
59
69
|
All methods return an Vpsa::Client::Response object. This objects contains the following attributes:
|
60
70
|
|
data/lib/vpsa/api/provisions.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Vpsa
|
2
2
|
module Api
|
3
3
|
class Provisions < Client
|
4
|
-
base_uri "https://www.vpsa.com.br/apps/api/provisoes"
|
4
|
+
base_uri "https://www.vpsa.com.br/apps/api/provisoes-contas"
|
5
5
|
|
6
6
|
def create(data)
|
7
7
|
return parse_response(self.class.post("/", :body => build_body(data), :headers => header))
|
data/lib/vpsa/version.rb
CHANGED
@@ -5,7 +5,7 @@ RSpec.describe Vpsa::Api::Provisions do
|
|
5
5
|
|
6
6
|
describe "listing" do
|
7
7
|
before(:each) do
|
8
|
-
stub_request(:post, "https://www.vpsa.com.br/apps/api/provisoes/").to_return(:status => 201)
|
8
|
+
stub_request(:post, "https://www.vpsa.com.br/apps/api/provisoes-contas/").to_return(:status => 201)
|
9
9
|
end
|
10
10
|
|
11
11
|
let(:provision_param) {{:"idLancamentoPadrao" => 3, :"idEntidade" => 1, :"idTerceiro" => 2, :data => "25-02-2019", :valor => "123.50", :historico => "histórico"}}
|