vauchar_api 0.4.1 → 0.4.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6dc69fad3388d4ce6ceb27e98836609912a54af81d418d40fc35a78741d7d1b9
4
- data.tar.gz: b3ba64b394eed6bb2db9940e10c961d12eefecd4f8d18cf79e98cc8b3c084183
3
+ metadata.gz: 0f051bb75d41f0b34f05f14f36391ca100ce5d0da2e3c70fced8431d98734ce8
4
+ data.tar.gz: cfb6b08f8959677cc68fc999577da526128cead0838aa9f08bb21ea45e5b3781
5
5
  SHA512:
6
- metadata.gz: 442327f3ae04ae2ece8e9d34a0885e119df2a53653e94c5f16744f02a5d7895b6046c985fdb4a4f47434de8cf2decf812765d2793aee68984fe9d1fb9fe1a21e
7
- data.tar.gz: 1c4c425d186d58e89b07bc972da4b35ff245e3ce37384249525be10561d0cb27e4fd6e8ca85b8bd73e7c51830350495bb7b0b19a5200d9eb7d546e76e5c023f8
6
+ metadata.gz: 8834d5a00ab53ffee993b3b66f89e113d6649e026ee8aaa60fe4759a1ab61a8806d702abad052dbb508f3643a46fa22dd1465244012138d140177cf91a1aedb8
7
+ data.tar.gz: c9005aea9e6f700952f74eda0e61f1819c4633b7084c59e5847666c7bf67a38574ca1076bb36cfc2cac0c9a92eda9bc2398293281bc737401256617eeaba66d8
@@ -1,14 +1,15 @@
1
1
  module ActiveResource
2
2
  module Formats
3
3
  def self.remove_root(data)
4
- begin
4
+ begin
5
5
  data = data.with_indifferent_access
6
- data = data.key?(:data) ? data[:data] : data
6
+ data = data.key?(:data) ? data[:data] : data
7
7
  rescue
8
8
  end
9
- p "Formats==================================="
10
- p data
11
- p "=========================================="
9
+
10
+ p "### Formats ###"
11
+ y data
12
+
12
13
  if data.is_a?(Hash) && data.keys.size == 1 && data.values.first.is_a?(Enumerable)
13
14
  data.values.first
14
15
  else
@@ -4,10 +4,8 @@ module VaucharAPI
4
4
 
5
5
  def delete_with_body(path, body = "", headers = {})
6
6
  with_auth do
7
- HTTParty.delete("#{site.scheme}://#{site.host}:#{site.port}#{path}", {
8
- headers: build_request_headers(headers, :delete, self.site.merge(path)),
9
- body: body,
10
- })
7
+ headers = build_request_headers(headers, :delete, self.site.merge(path))
8
+ HTTParty.delete("#{site.scheme}://#{site.host}:#{site.port}#{path}", { headers: headers, body: body })
11
9
  end
12
10
  end
13
11
 
@@ -35,7 +33,8 @@ module VaucharAPI
35
33
  payload[:path] = path
36
34
  payload[:response] = response
37
35
  payload[:data] = arguments
38
- p payload
36
+ p "### Notify About Request ###"
37
+ y payload
39
38
  end
40
39
  end
41
40
  end
@@ -10,7 +10,6 @@ module VaucharAPI
10
10
 
11
11
  def encode(options = {})
12
12
  same = dup
13
- p accepts_attributes
14
13
  same.attributes = same.attributes.slice(*accepts_attributes) if (accepts_attributes)
15
14
  same.send("to_#{self.class.format.extension}", options)
16
15
  end
@@ -10,13 +10,12 @@ module VaucharAPI
10
10
  end
11
11
 
12
12
  def self.destroy(params)
13
- begin
14
- redemption = VaucharAPI::VoucherRedemption.find({voucher_id: params[:voucher_id]})
15
- p redemption[:id]
13
+ begin
14
+ redemption = VaucharAPI::VoucherRedemption.find({ voucher_id: params[:voucher_id] })
16
15
  resource = delete("#{params[:voucher_id]}/redemptions/#{redemption[:id]}")
17
16
  rescue
18
17
  p "destroy fail!!"
19
18
  end
20
19
  end
21
20
  end
22
- end
21
+ end
@@ -1,3 +1,3 @@
1
1
  module VaucharAPI
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vauchar_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max