omie-client 0.1.6 → 0.1.7
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/lib/omie/company.rb +13 -7
- data/lib/omie/product.rb +12 -16
- data/lib/omie/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94419cf21c98a1561abc447b6b2573dff8000e5803eee8fbf8fe900f0c84e0f3
|
4
|
+
data.tar.gz: e6c9f7a717722a8defa94da9b70012f52eb867b204fc3c01cc21da31ee9044c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b494ee1e588966d557a3be0eeb43d6b1a9a858c736946a82e23a589a3a66182821a3826aa86b1dc1bd4101bf11b625f0de8b86367ae50608fe96c351f4a35be5
|
7
|
+
data.tar.gz: c83fd3c1f491968b12ba0336e6b233c2480c7c0574209f6ae0d87720ab4a1f8e459cc179739334958a3488d3f73301f3e5fbc6a4c9ca8f42aae4892ecb7584ea
|
data/lib/omie/company.rb
CHANGED
@@ -93,16 +93,22 @@ module Omie
|
|
93
93
|
# records.
|
94
94
|
#
|
95
95
|
# @!scope class
|
96
|
-
# @param
|
97
|
-
# the
|
98
|
-
#
|
99
|
-
# the number of items per page (max: 50).
|
96
|
+
# @param [Hash] options
|
97
|
+
# The options param follows the same structure described by
|
98
|
+
# https://app.omie.com.br/api/v1/geral/clientes/#clientes_list_request
|
100
99
|
# @return [Array<Omie::Company>]
|
101
100
|
# the list of found companies
|
102
|
-
def self.list(
|
103
|
-
|
101
|
+
def self.list(options = {})
|
102
|
+
default = {
|
103
|
+
pagina: 1, registros_por_pagina: 50,
|
104
|
+
apenas_importado_api: 'N'
|
105
|
+
}
|
106
|
+
|
107
|
+
default.each do |k, v|
|
108
|
+
options[k] = v unless options.key?(k)
|
109
|
+
end
|
104
110
|
|
105
|
-
response = request(URI, CALLS[:list],
|
111
|
+
response = request(URI, CALLS[:list], options)
|
106
112
|
response['clientes_cadastro'].map { |client| Omie::Company.new(client) }
|
107
113
|
rescue Omie::RequestError
|
108
114
|
[]
|
data/lib/omie/product.rb
CHANGED
@@ -94,26 +94,22 @@ module Omie
|
|
94
94
|
# records.
|
95
95
|
#
|
96
96
|
# @!scope class
|
97
|
-
# @param
|
98
|
-
# the
|
99
|
-
#
|
100
|
-
# the number of items per page (max: 50).
|
101
|
-
# @param only_imported [String]
|
102
|
-
# related to 'apenas_importado_api' params, accept 'S' or 'N'.
|
103
|
-
# @param only_pdv [String]
|
104
|
-
# related to 'filtrar_apenas_omiepdv' params, accept 'S' or 'N'.
|
97
|
+
# @param [Hash] options
|
98
|
+
# The options param follows the same structure described by
|
99
|
+
# https://app.omie.com.br/api/v1/geral/produtos/#produto_servico_list_request
|
105
100
|
# @return [Array<Omie::Product>]
|
106
101
|
# the list of found companies
|
107
|
-
def self.list(
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
pagina: page, registros_por_pagina: per_page,
|
112
|
-
apenas_importado_api: only_imported,
|
113
|
-
filtrar_apenas_omiepdv: only_pdv
|
102
|
+
def self.list(options = {})
|
103
|
+
default = {
|
104
|
+
pagina: 1, registros_por_pagina: 50,
|
105
|
+
apenas_importado_api: 'N', filtrar_apenas_omiepdv: 'N'
|
114
106
|
}
|
115
107
|
|
116
|
-
|
108
|
+
default.each do |k, v|
|
109
|
+
options[k] = v unless options.key?(k)
|
110
|
+
end
|
111
|
+
|
112
|
+
response = request(URI, CALLS[:list], options)
|
117
113
|
response['produto_servico_cadastro'].map do |product|
|
118
114
|
Omie::Product.new(product)
|
119
115
|
end
|
data/lib/omie/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omie-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peerdustry
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|