tinyerp_ruby 0.4.3 → 0.4.4
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 +8 -8
- data/README.md +4 -2
- data/lib/tinyerp_ruby/poster.rb +2 -1
- data/lib/tinyerp_ruby/version.rb +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
|
+
NzEzNThkZjExZTFjYzVhZDU2MWY3ZGViMWZlYjVjMmZhNDViNGE1MA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NGU1MTlkNzQ0OWY0MWI4OGZjMjg4NGIxNGE0N2M1ZWRmMzIxMjllZQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NWZjZTM1MmRmZmJiNTE1Yzg3YjJkN2U2ZTg3NmEwYjVjNjY3ODMxNjc5NjEx
|
10
|
+
YTMzZjdhNTRmMjEyNDhmZjMzMmRkYTFjNjU0NjZjZDlmMzEwNTI3OGFkMjQw
|
11
|
+
ZDFiZmVjYzIyM2FmMDM5YjlhMGRlZTM2NzQ2MjA1OGJkMDMwNmU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MWEwNmVlYzc0ZTJhZWY3MTQ2MThjMDU3ZWU5MDQ1ZTEzNWFkNjU2MTgwYjk4
|
14
|
+
MjkxYjBkZWRhY2FhMWY0MTU5NmVkOGRkNDZkNmY3OGUyMmYxNWU4OTE5ZmI3
|
15
|
+
MDk0MWMzYTZkYmExNTZlZjhkMzNjMTVhNWU3MTA0ZjZjMmE3YTk=
|
data/README.md
CHANGED
@@ -7,6 +7,8 @@ by [Locomotiva.pro](http://locomotiva.pro)
|
|
7
7
|
|
8
8
|
Gem for integration with [TinyERP](http://www.tiny.com.br) API. At the moment this gem is tested under ruby 1.9.3 and have some problems with ruby 2.0 because an weird behaviour with encoding.
|
9
9
|
|
10
|
+
#### Warning at this moment this gem does not work with ruby 2.0 on OsX.
|
11
|
+
|
10
12
|
## Installation
|
11
13
|
|
12
14
|
Add this line to your application's Gemfile:
|
@@ -35,11 +37,11 @@ Then we create a service object.
|
|
35
37
|
|
36
38
|
poster = TinyerpRuby::Service.new connection
|
37
39
|
|
38
|
-
With service object created we just need to call the api methods and pass a hash according api description.
|
40
|
+
With service object created we just need to call the api methods and pass a hash according api description. Keep note that you must pass a hash of size one, where the key is the symbol with the parameter according to Tiny API and the value is another hash formatted according to Tiny API too.
|
39
41
|
|
40
42
|
params = {....}
|
41
43
|
return_params = poster.pesquisar_vendedores_service(id: params)
|
42
|
-
return_params = poster.incluir_pedido_service(pedido: params
|
44
|
+
return_params = poster.incluir_pedido_service(pedido: params)
|
43
45
|
|
44
46
|
The list with complete api method is found [here.](http://www.tiny.com.br/manuais/api2/)
|
45
47
|
|
data/lib/tinyerp_ruby/poster.rb
CHANGED
@@ -14,9 +14,10 @@ module TinyerpRuby
|
|
14
14
|
|
15
15
|
private
|
16
16
|
def formatted_params(params)
|
17
|
+
params = params.first
|
17
18
|
formatted = { token: @connection.api_key }
|
18
19
|
formatted.delete(:formato)
|
19
|
-
formatted.merge!(params)
|
20
|
+
formatted.merge!({params.first => params.last.to_json})
|
20
21
|
formatted.merge!({formato: 'json'})
|
21
22
|
formatted
|
22
23
|
end
|
data/lib/tinyerp_ruby/version.rb
CHANGED