bling_api 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- 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 +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10f3e0abf05620ac8d795ea49272d18ec388494248fa3a85178fd6e9ec496488
|
4
|
+
data.tar.gz: c0efbb931037f47f88acde597995d0925956bbe42f909c0b3bb803f004d3850b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15dcd2c8b672d379691b40f3b15c1441b659936ffaca1957f69da3b8188194e45b00cbca12f13de2eb26ff533f742b41bf1df0d3d6bea4ebbbb4f0ee5891016d
|
7
|
+
data.tar.gz: c8ebec0245600208a0c0da2b25d7aca0a8c462c716b203236af5a6dadd45ae3eddb2ad5fb1feaacb58e0b11dd7da9b9ac208f0922eb6a4f91df827570e439098
|
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.5)
|
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,7 +1,7 @@
|
|
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.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- caio
|
@@ -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
|