acumatica 0.1.3 → 0.2.0

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: a65374762422990b7901ef98c76b72c61440537b
4
- data.tar.gz: 49ef4a74843f6c3bdd6a504a7b0a2359b4a5b85f
3
+ metadata.gz: 64d9f03044d51472d021a37cbdc70f85668e62ed
4
+ data.tar.gz: 574ea1905f485751dae73186742f59813602c136
5
5
  SHA512:
6
- metadata.gz: 35ead76fe6d9e393f097a7deb9b71267ce26786cb8e50ad7a94e1406bca301dd51d94844f6876d46c0dbbae3a0c28b27a29e4aaa62354150e766c262ea850bbb
7
- data.tar.gz: 30bd5572110c077b2888cfd96dfb023fed8d225dbfea339ce8fd1e01f04c30009a1d69cf675c1bfa843710fd346ff09b7cf54d1a98a0d0f18e822298ef795409
6
+ metadata.gz: 789e5585c066b513961ef4922849230d637e49e9f6b2984eb37cfeb26b5a79c45153b5324bb58105a35e1b8b1451faa812c2a4f2c2b0f349678f069a5a451c89
7
+ data.tar.gz: 6767eefc6a7d1d37699072f4469319536929f5cfba311d19cc7461dd80c2a00d5de7213c0a9346f8149d04a3015810349937c23f01837fe3f525a4ab296f69d8
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- acumatica (0.1.0)
4
+ acumatica (0.2.0)
5
5
  faraday
6
6
  faraday-cookie_jar
7
7
  faraday_middleware
data/README.md CHANGED
@@ -37,11 +37,22 @@ acumatica.stock_items.find_all(
37
37
  expand: 'Attributes'
38
38
  )
39
39
 
40
+ acumatica.stock_items.create({
41
+ "InventoryID": { "value": "TEST" },
42
+ "Description": { "value": "Test Item" },
43
+ "Attributes": [
44
+ {
45
+ "AttributeID": { "value": "Manufacturer" },
46
+ "Value": { "value": "ACME" }
47
+ }
48
+ ]
49
+ })
50
+
40
51
  acumatica.logout
41
52
  ```
42
53
 
43
54
  ## NOTES
44
- - Currently only querying of StockItems has been implemented - pull requests welcome!
55
+ - Currently only querying and creating StockItems has been implemented - pull requests welcome!
45
56
  - Querying Acumatica can be very slow, account for that when designing your integration.
46
57
  - Some Acumatica installations limit the number of concurrent users, so make sure to logout when finished.
47
58
 
@@ -15,7 +15,7 @@ module Acumatica
15
15
  @connection ||= Faraday.new do |conn|
16
16
  conn.request :json
17
17
 
18
- if token.present?
18
+ if token
19
19
  conn.request :oauth2, token
20
20
  else
21
21
  conn.use :cookie_jar
@@ -1,5 +1,12 @@
1
1
  module Acumatica
2
2
  class StockItem < OpenStruct
3
+ def self.create(params)
4
+ Acumatica::Client.instance.connection.put do |req|
5
+ req.url url
6
+ req.body = params
7
+ end
8
+ end
9
+
3
10
  def self.find_all(select: nil, filter: nil, expand: nil, offset: nil, limit: nil)
4
11
  params = {}
5
12
 
@@ -1,3 +1,3 @@
1
1
  module Acumatica
2
- VERSION = "0.1.3"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acumatica
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jared Moody
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-20 00:00:00.000000000 Z
11
+ date: 2018-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -191,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
191
191
  version: '0'
192
192
  requirements: []
193
193
  rubyforge_project:
194
- rubygems_version: 2.5.2
194
+ rubygems_version: 2.6.11
195
195
  signing_key:
196
196
  specification_version: 4
197
197
  summary: A wrapper for the acumatica API