bling_api 0.1.4 → 0.1.6
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/Gemfile.lock +2 -2
- data/lib/bling_api/customer.rb +5 -5
- data/lib/bling_api/order.rb +2 -2
- data/lib/bling_api/product.rb +1 -1
- data/lib/bling_api/version.rb +1 -1
- data/lib/bling_api.rb +1 -2
- data/lib/generators/bling_api/install/install_generator.rb +10 -0
- data/lib/generators/bling_api/install/templates/initializer.rb +3 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 205aa615619dae0b7e3d4ffc084e5cc353e52b22b8c8df6da36f50f2638fd816
|
4
|
+
data.tar.gz: 8f9918c4f1251e6ce4c1e4f506166d6a819819664e8c70ad8642a1386726d203
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: caa5ed433a4afd863dcaa72e025faf87e8a827d88c0eecb8213591d91c5480c94ca47afcd6eb9b4bf5dc43fc885ffd33df207bad8d7766d26393a0e1724047c2
|
7
|
+
data.tar.gz: a2a4de3e89417613c6733e4a3404393d269f1afe2fd711df667a2d8959d488fbb798f53e6b5e36d853a0b07cc1463f1ec21cd22ad87ccd47d2367714874932e8
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
bling_api (0.1.
|
4
|
+
bling_api (0.1.6)
|
5
5
|
ac
|
6
6
|
base64
|
7
7
|
|
@@ -11,7 +11,7 @@ GEM
|
|
11
11
|
ac (0.1.1)
|
12
12
|
typhoeus
|
13
13
|
attr_extras (7.1.0)
|
14
|
-
base64 (0.
|
14
|
+
base64 (0.2.0)
|
15
15
|
concurrent-ruby (1.2.2)
|
16
16
|
diff-lcs (1.5.0)
|
17
17
|
ethon (0.16.0)
|
data/lib/bling_api/customer.rb
CHANGED
@@ -2,15 +2,15 @@ module BlingApi
|
|
2
2
|
class Customer
|
3
3
|
|
4
4
|
def self.find_by_tax_id tax_id
|
5
|
-
response_json = Client.new(BlingApi.access_token).find_contact_by_document_number(tax_id)
|
5
|
+
response_json = Client.new(BlingApi.configuration.access_token).find_contact_by_document_number(tax_id)
|
6
6
|
if response_json
|
7
|
-
contact = Client.new(BlingApi.access_token).get_contact(response_json["id"])
|
7
|
+
contact = Client.new(BlingApi.configuration.access_token).get_contact(response_json["id"])
|
8
8
|
new(**build_hash(contact))
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
12
|
def self.find_by_id id
|
13
|
-
contact = Client.new(BlingApi.access_token).get_contact(id)
|
13
|
+
contact = Client.new(BlingApi.configuration.access_token).get_contact(id)
|
14
14
|
new(**build_hash(contact))
|
15
15
|
end
|
16
16
|
|
@@ -66,12 +66,12 @@ module BlingApi
|
|
66
66
|
instance_variable_set("@#{key}", value)
|
67
67
|
end
|
68
68
|
end
|
69
|
-
Client.new(BlingApi.access_token).update_contact(id, JSON.dump(build_json))
|
69
|
+
Client.new(BlingApi.configuration.access_token).update_contact(id, JSON.dump(build_json))
|
70
70
|
self.class.find_by_id(self.id)
|
71
71
|
end
|
72
72
|
|
73
73
|
def create
|
74
|
-
response = Client.new(BlingApi.access_token).create_contact(JSON.dump(build_json))
|
74
|
+
response = Client.new(BlingApi.configuration.access_token).create_contact(JSON.dump(build_json))
|
75
75
|
self.class.find_by_id(response["id"])
|
76
76
|
end
|
77
77
|
|
data/lib/bling_api/order.rb
CHANGED
@@ -2,7 +2,7 @@ module BlingApi
|
|
2
2
|
class Order
|
3
3
|
|
4
4
|
def self.find_by_id id
|
5
|
-
response = Client.new(BlingApi.access_token).get_order(id)
|
5
|
+
response = Client.new(BlingApi.configuration.access_token).get_order(id)
|
6
6
|
new(**build_hash(response))
|
7
7
|
end
|
8
8
|
|
@@ -58,7 +58,7 @@ module BlingApi
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def create
|
61
|
-
response = Client.new(BlingApi.access_token).create_order(JSON.dump(build_json))
|
61
|
+
response = Client.new(BlingApi.configuration.access_token).create_order(JSON.dump(build_json))
|
62
62
|
self.class.find_by_id(response["id"])
|
63
63
|
end
|
64
64
|
|
data/lib/bling_api/product.rb
CHANGED
@@ -2,7 +2,7 @@ module BlingApi
|
|
2
2
|
class Product
|
3
3
|
|
4
4
|
def self.find_by_sku sku
|
5
|
-
response_json = Client.new(BlingApi.access_token).find_product_by_sku(sku)
|
5
|
+
response_json = Client.new(BlingApi.configuration.access_token).find_product_by_sku(sku)
|
6
6
|
if response_json
|
7
7
|
new(**build_hash(response_json))
|
8
8
|
end
|
data/lib/bling_api/version.rb
CHANGED
data/lib/bling_api.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bling_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- caio
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-11-
|
11
|
+
date: 2023-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ac
|
@@ -56,6 +56,8 @@ files:
|
|
56
56
|
- lib/bling_api/order.rb
|
57
57
|
- lib/bling_api/product.rb
|
58
58
|
- lib/bling_api/version.rb
|
59
|
+
- lib/generators/bling_api/install/install_generator.rb
|
60
|
+
- lib/generators/bling_api/install/templates/initializer.rb
|
59
61
|
homepage: https://github.com/CaioGarcia1
|
60
62
|
licenses:
|
61
63
|
- MIT
|