varejonline 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/varejonline/api/orders.rb +6 -3
- data/lib/varejonline/api/products.rb +9 -2
- data/lib/varejonline/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f89304ed5fadd5d49a2db5eb96dfacd18fafaa35
|
4
|
+
data.tar.gz: df6c1a32355f9a5b15a70ade7fa8527dd844c0cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4779615760719fb30a1aac4385b2563084d3c46f2bf48f39ee8adbd1947ea103832a26cdbb2605f1a20d36b4901fd519254edfbb634db2efe5883a0ef76b48a
|
7
|
+
data.tar.gz: 3a717b8357d3dca847643d87894a8ffa9657e778b7ad6e32842192f1032fcd43ac49d3b0b8603ae7b2fd015b8982d3eea3636548b7927bad28ab6921f69596ce
|
@@ -17,10 +17,13 @@ module Varejonline
|
|
17
17
|
return parse_response(self.class.get("/#{id}", body: build_body, headers: header))
|
18
18
|
end
|
19
19
|
|
20
|
-
def save(
|
21
|
-
|
22
|
-
return parse_response(self.class.post('/', body: build_body(
|
20
|
+
def save(data)
|
21
|
+
return parse_response(self.class.post('/', body: build_body(data), headers: header)) if data.is_a?(Hash)
|
22
|
+
return parse_response(self.class.post('/', body: build_body(data.as_parameter), headers: header)) if data.is_a?(Varejonline::Entity::Commercial::Order)
|
23
|
+
|
24
|
+
raise ArgumentError
|
23
25
|
end
|
26
|
+
alias :create :save
|
24
27
|
end
|
25
28
|
end
|
26
29
|
end
|
@@ -18,11 +18,18 @@ module Varejonline
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def save(data)
|
21
|
-
return parse_response(self.class.post('/', body: build_body(data
|
21
|
+
return parse_response(self.class.post('/', body: build_body(data), headers: header)) if data.is_a?(Hash)
|
22
|
+
return parse_response(self.class.post('/', body: build_body(data.as_parameter), headers: header)) if data.is_a?(Varejonline::Entity::Commercial::Product)
|
23
|
+
|
24
|
+
raise ArgumentError
|
22
25
|
end
|
26
|
+
alias :create :save
|
23
27
|
|
24
28
|
def update(id, data)
|
25
|
-
return parse_response(self.class.put("/#{id}", body: build_body(data
|
29
|
+
return parse_response(self.class.put("/#{id}", body: build_body(data), headers: header)) if data.is_a?(Hash)
|
30
|
+
return parse_response(self.class.put("/#{id}", body: build_body(data.as_parameter), headers: header)) if data.is_a?(Varejonline::Entity::Commercial::Product)
|
31
|
+
|
32
|
+
raise ArgumentError
|
26
33
|
end
|
27
34
|
end
|
28
35
|
end
|
data/lib/varejonline/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: varejonline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Coyô
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|