dynaccount 0.9.1 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dynaccount.rb +2 -2
- data/lib/dynaccount/debtor.rb +1 -1
- data/lib/dynaccount/dynaccount_object.rb +2 -1
- data/lib/dynaccount/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d03679ac449d03bad50ff56d535b6d10322380d1
|
4
|
+
data.tar.gz: '08be1b1f60423494ca0202d702baedaa12e2bd04'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7bba340e59aa2e63eafd8ec3d550476a8b5ac507468c696617f769ae87e950128404a0c771f89e34eae7d74f5d14c53cefe25fe8b796c8e48293f955441c1600
|
7
|
+
data.tar.gz: 38cc26aaf3e65bd0322daf9c20de4d7eae36053282afbf76dd5e6c903aec6ebab1e821fb81454b917462672f4ce181be27559968630bb270a52cacef85169dbb
|
data/lib/dynaccount.rb
CHANGED
@@ -76,12 +76,12 @@ module Dynaccount
|
|
76
76
|
@base_url = 'api.dynaccount.com'
|
77
77
|
|
78
78
|
class << self
|
79
|
-
attr_accessor :api_key, :api_base, :api_secret, :api_id
|
79
|
+
attr_accessor :api_key, :api_base, :api_secret, :api_id, :debug
|
80
80
|
|
81
81
|
def request(url, params = {}, _method = :post)
|
82
82
|
@api_connection ||= Faraday.new(url: "https://#{@base_url}") do |faraday|
|
83
83
|
faraday.request :url_encoded
|
84
|
-
faraday.response :logger, ::Logger.new(STDOUT), bodies:
|
84
|
+
faraday.response :logger, ::Logger.new(STDOUT), bodies: (debug.present? ? debug : false)
|
85
85
|
faraday.adapter :net_http_persistent
|
86
86
|
end
|
87
87
|
|
data/lib/dynaccount/debtor.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Dynaccount
|
2
2
|
class Debtor < DynaccountObject
|
3
3
|
def self.ignore_put
|
4
|
-
[:id, :contact_id, :balance, :vatno_validation, :time_vatno_validation, :due]
|
4
|
+
[:id, :contact_id, :balance, :vatno_validation, :time_vatno_validation, :due, :is_blocked]
|
5
5
|
end
|
6
6
|
|
7
7
|
def self.api_path
|
@@ -25,7 +25,8 @@ module Dynaccount
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def self.create(attributes = {})
|
28
|
-
Dynaccount.request(url(nil, 'put'), attributes, :post).body
|
28
|
+
req = JSON.parse(Dynaccount.request(url(nil, 'put'), attributes, :post).body)['result'].map { |res| new(res) }
|
29
|
+
req[0]
|
29
30
|
end
|
30
31
|
|
31
32
|
def self.all
|
data/lib/dynaccount/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dynaccount
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Frederik Spang
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|