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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3518f82973526d4ec3fbfaefaa9b7ccc668caea6
4
- data.tar.gz: fda407e1e6738660e89202707e91507073fa1ed9
3
+ metadata.gz: f89304ed5fadd5d49a2db5eb96dfacd18fafaa35
4
+ data.tar.gz: df6c1a32355f9a5b15a70ade7fa8527dd844c0cb
5
5
  SHA512:
6
- metadata.gz: 9cd058460fb1262303239e9d327d71c19ff366364cf207647b4befecde90c7a84567e65cb839c190a98ba8c11c5928f64e841840b19f08d5d88fcf342598c879
7
- data.tar.gz: 5e4041f283de03bbe9595006dfc51c42126b1e2b1ef2986777086c7471df328912530cee1b4ef77d47a3aff7fb0ef8e03f4ea0d5f5f1f11124f820f68a3b01d2
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(order)
21
- raise ArgumentError unless order.nil? || order.is_a?(Varejonline::Entity::Commercial::Order)
22
- return parse_response(self.class.post('/', body: build_body(order.as_parameter), headers: header))
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.as_parameter), headers: header))
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.as_parameter), headers: header))
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
@@ -1,3 +1,3 @@
1
1
  module Varejonline
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
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.0
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-25 00:00:00.000000000 Z
11
+ date: 2017-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler