bseller_ruby 0.1.8.1 → 0.1.9

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b6872c1244f218fe84660b273adda3d9d0742a96
4
- data.tar.gz: 2b2903303a84c8df3ef07801f61799b73c3f23a5
3
+ metadata.gz: 82596f8c54d53e4942e7af32993fb51174c17ccc
4
+ data.tar.gz: 302e667a5bb527ab8fe976e2d690d378e4777700
5
5
  SHA512:
6
- metadata.gz: e1008d1a7cfc4ec9025e242df16d67b39dd0e6b8d4eecb4a5ccf2d09099dbd23729256e335b6f89351d1b5a4440627a4432c9d308d1fa17779f697c0e9bbca6a
7
- data.tar.gz: 85db9c5c61a5e228dd3f9a2f40bd8b29553356da04afbb6f64e1972a05cbf07ddd2411b00806e789a0b53b1bf13911e84cee61e23c4066f81182e323312ca738
6
+ metadata.gz: b3d91dc750e3e809554c1fc57a17b93a512749336fc9f91bd0c79fef9fe1f7b052f535f993fe976e2fbcbbea9362a346bfb6c06d61be666d16cb9529297182b6
7
+ data.tar.gz: 0ffaf12e73c3dbca15b7d72ac4c7064d4e0e55a0c860fb3485e6240de065e30ce747e344493e54d29eee62cf0a8dfb39641c82c97fe5d037c181a055fd788af5
@@ -29,7 +29,7 @@ module BsellerRuby
29
29
  end
30
30
 
31
31
  def collection_name
32
- @collection_name ||= "#{resource_name}s"
32
+ @collection_name = "#{resource_name}s"
33
33
  end
34
34
 
35
35
  def call(method, params)
@@ -51,7 +51,7 @@ module BsellerRuby
51
51
  end
52
52
 
53
53
  def put(resource, path, payload)
54
- execute(:put, "#{resource}/#{path}", body: payload)
54
+ json_parse(execute(:put, "#{resource}/#{path}?a=1", body: payload))
55
55
  end
56
56
  end
57
57
 
@@ -80,7 +80,7 @@ module BsellerRuby
80
80
  end
81
81
 
82
82
  def self.api
83
- @api ||= Savon.client wsdl: "#{ws['soap_endpoint']}/#{get_wsdl}?wsdl", log: ws['log'], read_timeout: 600, open_timeout: 600 do
83
+ @api = Savon.client wsdl: "#{ws['soap_endpoint']}/#{get_wsdl}?wsdl", log: true, read_timeout: 600, open_timeout: 600 do
84
84
  convert_request_keys_to :camelcase
85
85
  end
86
86
  end
@@ -95,7 +95,7 @@ module BsellerRuby
95
95
 
96
96
  def self.authentication
97
97
  unless @method =~ /pagamento/
98
- @authentication ||= { 'idCia' => ws['cia_id'], 'usuario' => ws['username'], 'senha' => ws['password'] }
98
+ @authentication = { 'idCia' => ws['cia_id'], 'usuario' => ws['username'], 'senha' => ws['password'] }
99
99
  @method.to_s.end_with?('pedido') ? {} : @authentication
100
100
  end
101
101
  @authentication || {}
@@ -2,6 +2,36 @@ module BsellerRuby
2
2
  class Item < Base
3
3
  attr_reader :response
4
4
 
5
+ PATH = "itens"
6
+
7
+ # Retorno:
8
+ # {
9
+ # "batchNumber": 0,
10
+ # "content": [
11
+ # {
12
+ # "codigoDepartamento": 0,
13
+ # "codigoItem": "string",
14
+ # "estoqueEstabelecimento": [
15
+ # {
16
+ # "codigoEstabelecimento": 0,
17
+ # "dataDisponivel": "2016-05-07T19:10:38.803Z",
18
+ # "prazoDisponivel": 0,
19
+ # "quantidade": 0
20
+ # }
21
+ # ]
22
+ # }
23
+ # ],
24
+ # "totalElements": 0
25
+ # }
26
+ #
27
+ def self.massive(params)
28
+ get("#{PATH}/massivo", params)
29
+ end
30
+
31
+ def self.massive_confirm(batch: nil)
32
+ put("#{PATH}/massivo", batch, nil)
33
+ end
34
+
5
35
  # <maxReg />: 9(9), Quantidade máxima de registros a ser retornada.
6
36
  # Se nulo ou zero trás todos os registros disponíveis.
7
37
  #
@@ -31,7 +61,7 @@ module BsellerRuby
31
61
  #
32
62
  #<tpInterface />: X(15), Não, Código do tipo de interface
33
63
  def self.find(id_item, interface=nil)
34
- get("itens/#{id_item}", interface ? {tpInterface: interface} : nil)
64
+ get("#{PATH}/#{id_item}", interface)
35
65
  end
36
66
  end
37
67
  end
@@ -2,19 +2,15 @@ module BsellerRuby
2
2
  class Price < Base
3
3
  attr_reader :response
4
4
 
5
+ PATH = "itens/precos"
6
+
5
7
  def self.list(params = {})
6
- get(path, params)
8
+ get(PATH, params)
7
9
  end
8
10
 
9
11
  def self.confirm(cod_item, params = {})
10
- post("#{path}/status/#{cod_item}?#{to_params(params)}", {})
12
+ post("#{PATH}/status/#{cod_item}?#{to_params(params)}", {})
11
13
  end
12
-
13
- private
14
-
15
- def self.path
16
- 'itens/precos'
17
- end
18
14
  end
19
15
  end
20
16
 
@@ -1,3 +1,3 @@
1
1
  module BsellerRuby
2
- VERSION = "0.1.8.1"
2
+ VERSION = "0.1.9"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bseller_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8.1
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wesley Conde
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-04-05 00:00:00.000000000 Z
11
+ date: 2016-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: savon
@@ -185,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
185
185
  version: '0'
186
186
  requirements: []
187
187
  rubyforge_project:
188
- rubygems_version: 2.4.3
188
+ rubygems_version: 2.6.3
189
189
  signing_key:
190
190
  specification_version: 4
191
191
  summary: Bseller