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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: befd54f7842900c4b9372e30ab00755985e8882b
4
- data.tar.gz: 9a4c11bc8210f6664c73594678a28c08c3068844
3
+ metadata.gz: d03679ac449d03bad50ff56d535b6d10322380d1
4
+ data.tar.gz: '08be1b1f60423494ca0202d702baedaa12e2bd04'
5
5
  SHA512:
6
- metadata.gz: a4e6373337227581923c9e8b69e5a99705d9394d9260cd2f90b50b0957178b08abe73db1c8c3330a6932b214e06aafab2ba2b5ee0f73f2d150fe0222f9d46e6f
7
- data.tar.gz: f7197f93f982d53ddf4e579f3605041326a6a678e18dc3afe0eedc9ed9879e033f5cde6a8081da647e3e644485b564451105aff5d3ae1f9b6bdbea24e0cc09ed
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: true
84
+ faraday.response :logger, ::Logger.new(STDOUT), bodies: (debug.present? ? debug : false)
85
85
  faraday.adapter :net_http_persistent
86
86
  end
87
87
 
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Dynaccount
2
- VERSION = '0.9.1'.freeze
2
+ VERSION = '0.9.2'.freeze
3
3
  end
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.1
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-01-23 00:00:00.000000000 Z
11
+ date: 2017-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json