myob-api 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/myob-api.rb +2 -1
- data/lib/myob/api/client.rb +4 -2
- data/lib/myob/api/helpers.rb +4 -3
- data/lib/myob/api/models/base.rb +1 -1
- data/lib/myob/api/models/company.rb +8 -0
- data/lib/myob/api/models/company_file.rb +2 -2
- data/lib/myob/api/models/contact.rb +2 -2
- data/lib/myob/api/models/customer.rb +2 -2
- data/lib/myob/api/models/employee.rb +2 -2
- data/lib/myob/api/models/employee_payroll_details.rb +2 -2
- data/lib/myob/api/models/payroll_category.rb +2 -2
- data/lib/myob/api/models/timesheet.rb +2 -2
- data/lib/myob/api/models/wage.rb +2 -2
- data/lib/myob/api/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ef80a14f547ae468f20fa07170184aca8417eb7
|
4
|
+
data.tar.gz: 4161ecc3956d6a4dc9a3c4882a6d9948300a7660
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c06514b379ebdaccaa94fd4f3d9427b3f5669ed36e99b475a23a3c479f59e6bae0facdda3c65110b12575648db07b63f745299c18ce24c7f05f239326169bfc7
|
7
|
+
data.tar.gz: a6eea9fe94c3e77d5aa529d28164f6134a7ad70ffafe872deb312786718b01116d4b99a8a2dd143990f0a57d163c72c7256936701e5b9a2f7d685782c5b70b9e
|
data/lib/myob-api.rb
CHANGED
@@ -4,6 +4,7 @@ require 'myob/api/helpers'
|
|
4
4
|
|
5
5
|
require 'myob/api/models/base'
|
6
6
|
require 'myob/api/models/company_file'
|
7
|
+
require 'myob/api/models/company'
|
7
8
|
|
8
9
|
require 'myob/api/models/contact'
|
9
10
|
require 'myob/api/models/customer'
|
@@ -15,4 +16,4 @@ require 'myob/api/models/wage'
|
|
15
16
|
|
16
17
|
require 'myob/api/models/timesheet'
|
17
18
|
|
18
|
-
require 'myob/api/client'
|
19
|
+
require 'myob/api/client'
|
data/lib/myob/api/client.rb
CHANGED
@@ -11,6 +11,8 @@ module Myob
|
|
11
11
|
def initialize(options)
|
12
12
|
model :CompanyFile
|
13
13
|
|
14
|
+
model :Company
|
15
|
+
|
14
16
|
model :Contact
|
15
17
|
model :Customer
|
16
18
|
model :Employee
|
@@ -62,7 +64,7 @@ module Myob
|
|
62
64
|
company_file_id = self.company_file.first('Name' => company_file[:name])['Id']
|
63
65
|
@current_company_file = {
|
64
66
|
:id => company_file_id,
|
65
|
-
:token => Base64.encode64("#{company_file[:username]}:#{company_file[:password]}"),
|
67
|
+
:token => company_file[:token] || Base64.encode64("#{company_file[:username]}:#{company_file[:password]}"),
|
66
68
|
}
|
67
69
|
end
|
68
70
|
|
@@ -78,4 +80,4 @@ module Myob
|
|
78
80
|
|
79
81
|
end
|
80
82
|
end
|
81
|
-
end
|
83
|
+
end
|
data/lib/myob/api/helpers.rb
CHANGED
@@ -12,10 +12,11 @@ module Myob
|
|
12
12
|
module Api
|
13
13
|
module Helpers
|
14
14
|
def model(model_name)
|
15
|
-
|
15
|
+
method_name = model_name.to_s.underscore
|
16
|
+
variable_name = "@#{method_name}_model".to_sym
|
16
17
|
unless instance_variable_defined?(variable_name)
|
17
18
|
instance_variable_set(variable_name, Myob::Api::Model.const_get("#{model_name}".to_sym).new(self, model_name.to_s))
|
18
|
-
self.define_singleton_method(
|
19
|
+
self.define_singleton_method(method_name.to_sym) do
|
19
20
|
instance_variable_get(variable_name)
|
20
21
|
end
|
21
22
|
end
|
@@ -23,4 +24,4 @@ module Myob
|
|
23
24
|
end
|
24
25
|
end
|
25
26
|
end
|
26
|
-
end
|
27
|
+
end
|
data/lib/myob/api/models/base.rb
CHANGED
data/lib/myob/api/models/wage.rb
CHANGED
data/lib/myob/api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: myob-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Lumley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oauth2
|
@@ -69,6 +69,7 @@ files:
|
|
69
69
|
- lib/myob/api/client.rb
|
70
70
|
- lib/myob/api/helpers.rb
|
71
71
|
- lib/myob/api/models/base.rb
|
72
|
+
- lib/myob/api/models/company.rb
|
72
73
|
- lib/myob/api/models/company_file.rb
|
73
74
|
- lib/myob/api/models/contact.rb
|
74
75
|
- lib/myob/api/models/customer.rb
|