myob-api 0.7.1 → 0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/myob/api/client.rb +7 -5
- data/lib/myob/api/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: fd7d16454a5dd331bfb7ead95ff73e6bca504987
|
4
|
+
data.tar.gz: 354d7ee0fdfa37a0d467afb72742f50982a1e725
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f509295319d486f9d2a13f726e575d7500af66cafa96a8d4b0d33d4a5f2f27d2bec0551871cbc42ec20aece085ccd68fdca279a03d8eb185e7ec107f883f1107
|
7
|
+
data.tar.gz: 77e5b218728121d9e7bc75651152746ecaa4b08828af61b1f1453ba273719a25d4385cda1d7730e629c608505fcb1d77d448e588187fb295a9839b72b1306506
|
data/README.md
CHANGED
@@ -36,7 +36,7 @@ The MYOB API uses 3 legged OAuth2. If you don't want to roll your own, or use th
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def myob_client
|
39
|
-
@
|
39
|
+
@myob_client ||= Myob::Api::Client.new({
|
40
40
|
:consumer => {
|
41
41
|
:key => YOUR_CONSUMER_KEY,
|
42
42
|
:secret => YOUR_CONSUMER_SECRET,
|
@@ -160,7 +160,7 @@ To create a new entity, call #save on its model, passing through a hash that rep
|
|
160
160
|
#### Updating an entity
|
161
161
|
|
162
162
|
To update an existing entity, call #save on its model, passing through a hash you got from the API. This hash should include a `UID` parameter (which is included by default when you get the data).
|
163
|
-
|
163
|
+
|
164
164
|
user = api_client.employee.all["Items"].last
|
165
165
|
user['FirstName'] = 'New First Name'
|
166
166
|
api_client.employee.save(user)
|
data/lib/myob/api/client.rb
CHANGED
@@ -49,11 +49,13 @@ module Myob
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def select_company_file(company_file)
|
52
|
-
company_file_id = self.company_file.
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
52
|
+
company_file_id = (self.company_file.all.find {|file| file['Name'] == company_file[:name]} || [])['Id']
|
53
|
+
if company_file_id
|
54
|
+
@current_company_file = {
|
55
|
+
:id => company_file_id,
|
56
|
+
:token => company_file[:token] || Base64.encode64("#{company_file[:username]}:#{company_file[:password]}"),
|
57
|
+
}
|
58
|
+
end
|
57
59
|
end
|
58
60
|
|
59
61
|
def connection
|
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.
|
4
|
+
version: '0.8'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Lumley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oauth2
|