intacctrb 0.4.3 → 0.4.4

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: 49e5d51a1f9bf608a28c053058b4aa9c7f4692ee
4
- data.tar.gz: c9f8292524c62c76e3c5765e201d6232ee1f19cf
3
+ metadata.gz: 62c00ec8565e126d594edabcfc5dbe818da4d63a
4
+ data.tar.gz: fd39b538ad5dc035281df3a6ad41384cc900fd5b
5
5
  SHA512:
6
- metadata.gz: 797f7ed5bf41769e2f2df9223e79d767f43d8a2f429735146c358d3cf68a8cf69ab6b7b4b219eda132790714372a5cff11b18809b673788e8b0313fe09d89a78
7
- data.tar.gz: 5e0d76034d4a1c0ebe18a5ea0f63e6c9d955fafa00c259da80579eeb1ceb2735964eff1ef7dc5e7485b0a95a1ac327f96bbcb110905558e83bccab64d2fa747d
6
+ metadata.gz: 9e8fdf46a41788a242d14b6070a0f51d1bcd84dec7d62b1a4234c8303fd0e5f55238060d7ba217cbd8c653047c19027c524116dc36a40880b9725aa0b1e29570
7
+ data.tar.gz: 245dab18d268fed543da511ef9b3e58d099e3c04dd5e478e6b94f3750910d1c0d1f555f978728bf633a18125b4db2c914f3da9fbc30f265cd55061d9993ff9de
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- intacctrb (0.4.3)
4
+ intacctrb (0.4.4)
5
5
  hooks
6
6
  nokogiri
7
7
 
@@ -14,7 +14,11 @@ module IntacctRB
14
14
  }
15
15
  end
16
16
 
17
- successful?
17
+ if !successful?
18
+ raise IntacctRB::Exceptions::Attachment.new(response.at('//error//description2'))
19
+ end
20
+
21
+ object.intacct_id
18
22
  end
19
23
 
20
24
  def get_date_at(xpath, object)
@@ -17,7 +17,7 @@ module IntacctRB
17
17
  end
18
18
 
19
19
  if !successful?
20
- raise IntacctRB::Exceptions::Error.new(response.at('//error//description2'))
20
+ raise IntacctRB::Exceptions::Bill.new(response.at('//error//description2'))
21
21
  end
22
22
 
23
23
  object.intacct_id
@@ -0,0 +1,6 @@
1
+ module IntacctRB
2
+ module Exceptions
3
+ class Attachment < IntacctRB::Exceptions::Base
4
+ end
5
+ end
6
+ end
@@ -2,7 +2,11 @@ module IntacctRB
2
2
  module Exceptions
3
3
  class Base < StandardError
4
4
  def initialize(message)
5
- super(message)
5
+ error_class = self.class.to_s
6
+ error_class = error_class.split('::').last if error_class.index('::')
7
+ error_message = "#{error_class} error: "
8
+ error_message += message || 'Unknown'
9
+ super(error_message)
6
10
  end
7
11
  end
8
12
  end
@@ -1,6 +1,6 @@
1
1
  module IntacctRB
2
2
  module Exceptions
3
- class Error < IntacctRB::Exceptions::Base
3
+ class Bill < IntacctRB::Exceptions::Base
4
4
  end
5
5
  end
6
6
  end
@@ -0,0 +1,6 @@
1
+ module IntacctRB
2
+ module Exceptions
3
+ class Vendor < IntacctRB::Exceptions::Base
4
+ end
5
+ end
6
+ end
@@ -12,7 +12,7 @@ module IntacctRB
12
12
  end
13
13
 
14
14
  if !successful?
15
- raise response.at('//error//description2') || "Unknown error: #{response}"
15
+ raise IntacctRB::Exceptions::Vendor.new(response.at('//error//description2'))
16
16
  end
17
17
 
18
18
  new_vendor = response.xpath('//result//data//vendor').first
@@ -1,3 +1,3 @@
1
1
  module IntacctRB
2
- VERSION = "0.4.3"
2
+ VERSION = "0.4.4"
3
3
  end
data/lib/intacctrb.rb CHANGED
@@ -14,7 +14,9 @@ require "intacctrb/account"
14
14
  require "intacctrb/attachment"
15
15
 
16
16
  require "intacctrb/exceptions/base"
17
- require "intacctrb/exceptions/error"
17
+ require "intacctrb/exceptions/vendor"
18
+ require "intacctrb/exceptions/bill"
19
+ require "intacctrb/exceptions/attachment"
18
20
 
19
21
  class Object
20
22
  def blank?
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: intacctrb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Hale
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-11 00:00:00.000000000 Z
11
+ date: 2017-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -174,8 +174,10 @@ files:
174
174
  - lib/intacctrb/base.rb
175
175
  - lib/intacctrb/bill.rb
176
176
  - lib/intacctrb/customer.rb
177
+ - lib/intacctrb/exceptions/attachment.rb
177
178
  - lib/intacctrb/exceptions/base.rb
178
- - lib/intacctrb/exceptions/error.rb
179
+ - lib/intacctrb/exceptions/bill.rb
180
+ - lib/intacctrb/exceptions/vendor.rb
179
181
  - lib/intacctrb/invoice.rb
180
182
  - lib/intacctrb/journal_entry.rb
181
183
  - lib/intacctrb/vendor.rb