quickbooks-ruby-base 1.4.0 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/quickbooks/base.rb +13 -9
- data/lib/quickbooks/base/finders.rb +1 -1
- data/quickbooks-ruby-base.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZmVlZjM5YjNkN2ZiMjQ4YzcwN2I2YTY4YTZlNTkxYThmM2E5ZDVlZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OTI4MzMzN2IxYWZjNDBiZGFkZmFlNmJhODJiYzg1ZDMxNDU0YzVjZg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OWU1NmU0YmFjMmRkYjkyNzg2ZWM1ZGFjMWVjZGJlNjcwNzljMTg0MDc0OTZh
|
10
|
+
MmZjOGU0YWVhZTc3Nzk3MzA0ODYwZjNkZDFhZGFkYzI0ODBjOGYwZjUxYjY5
|
11
|
+
YmQ2NTQyNTliN2ZmMzE4NWE0Y2FkOGNiNDgyODhhNzE1NmIyZGY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
N2VjZWY0OWJiYjQ3NGYyYzYyN2ZmMDRkOGJlYTE2NTEwZTdkNjIxMmU5YzM0
|
14
|
+
NTk0MzcyZTgyZWI1ZGRmM2JhYmQ5NWNhMzVlMTc0NjgxMDE4ZTY3N2ZiMTEz
|
15
|
+
MDNhMjQ1YTQxNGFlZDc0OWNhOTA4M2MxY2FkZDU0NzQzMGFmZTE=
|
data/lib/quickbooks/base.rb
CHANGED
@@ -4,7 +4,7 @@ require_relative 'base/finders'
|
|
4
4
|
|
5
5
|
module Quickbooks
|
6
6
|
class Base
|
7
|
-
attr_reader :service
|
7
|
+
attr_reader :service
|
8
8
|
include Finders
|
9
9
|
extend Configuration
|
10
10
|
|
@@ -13,18 +13,18 @@ module Quickbooks
|
|
13
13
|
create_service_for(type) if type
|
14
14
|
end
|
15
15
|
|
16
|
-
def generate_quickbooks_ruby_namespace(
|
17
|
-
|
18
|
-
"Quickbooks::#{
|
16
|
+
def generate_quickbooks_ruby_namespace(type, variety = 'Model')
|
17
|
+
type = type.is_a?(Symbol) ? type.to_s.camelcase : type
|
18
|
+
"Quickbooks::#{variety}::#{type}"
|
19
19
|
end
|
20
20
|
|
21
|
-
def quickbooks_ruby_model(
|
22
|
-
generate_quickbooks_ruby_namespace(
|
21
|
+
def quickbooks_ruby_model(type, *args)
|
22
|
+
generate_quickbooks_ruby_namespace(type, 'Model').constantize.new(*args)
|
23
23
|
end
|
24
24
|
alias_method :qr_model, :quickbooks_ruby_model
|
25
25
|
|
26
|
-
def quickbooks_ruby_service(
|
27
|
-
generate_quickbooks_ruby_namespace(
|
26
|
+
def quickbooks_ruby_service(type)
|
27
|
+
generate_quickbooks_ruby_namespace(type, 'Service').constantize.new
|
28
28
|
end
|
29
29
|
alias_method :qr_service, :quickbooks_ruby_service
|
30
30
|
|
@@ -45,8 +45,12 @@ module Quickbooks
|
|
45
45
|
'nil'
|
46
46
|
end
|
47
47
|
|
48
|
+
def entity
|
49
|
+
@service.class.name.split('::').last
|
50
|
+
end
|
51
|
+
|
48
52
|
def describing_method
|
49
|
-
case
|
53
|
+
case entity
|
50
54
|
when /(Item|TaxCode|PaymentMethod|Account)/
|
51
55
|
'name'
|
52
56
|
when /(Invoice|CreditMemo)/
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'quickbooks-ruby-base'
|
7
|
-
spec.version = '1.
|
7
|
+
spec.version = '1.5.0'
|
8
8
|
spec.authors = ["Christian"]
|
9
9
|
spec.email = ["christian@minimul.com"]
|
10
10
|
spec.summary = %q{Base class to provide common methods for the quickbooks-ruby gem}
|