chartmogul-ruby 1.6.4 → 1.6.6

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
  SHA256:
3
- metadata.gz: 03dd80b98e7189b3840f423a811f21146cb92c9169108f7e7da0ef16c350c2ae
4
- data.tar.gz: 8bb2967e3b9831e9b4e86525b3e4e1b74128f34659120bac135fabaaadd8ba7c
3
+ metadata.gz: 48f89ffb09ae87641ce72a86933370c44a34f9bdfc3007e3cd0757e7e3ab86fc
4
+ data.tar.gz: 195daeabc4de7495673bf7a8066ac777743f2e52fe0c4d9a53e2e9562fec3c29
5
5
  SHA512:
6
- metadata.gz: 73be9c9e1de9add84e4135a2a85f555b2bb560e7a7ff3ca62383ff4897843199658e55a7cf1a9832a60b8970e7d69d3ab12c17f6437ce6943328f552d5919922
7
- data.tar.gz: fc21783797495408254b76d8552fef395aa82cc07d534b6b446b2c972483f6d880d9ee06514cdfc79ac1c9f93fc4e9fe2dce935153f7facf1254f57715519a6b
6
+ metadata.gz: c64c9287441ba417ddb56276eb2b7e993dc0cc41ad7448960dbe6bc9c852d64bd7d022f41fe702cafc0493d02e7f3f72f0c63b6b3c5391921bc86333acb78000
7
+ data.tar.gz: 16ef7f3cc9120ba2934979e4d3aa99b0b36ccfd42dc1d2018a3d2e650993cce5726706543200b718d7bfce233bbdf894be4ed67040859123d1dcae29df59fbba
data/.gitignore CHANGED
@@ -9,3 +9,4 @@
9
9
  /tmp/
10
10
  *.swp
11
11
  vendor/bundle
12
+ /.idea
@@ -64,14 +64,6 @@ module ChartMogul
64
64
  @invoices = ChartMogul::CustomerInvoices.new(customer_uuid: uuid, invoices: invoices_array)
65
65
  end
66
66
 
67
- def delete_all_invoices!
68
- path = ChartMogul::ResourcePath.new('v1/data_sources/:data_source_uuid/customers/:customer_uuid/invoices')
69
- handling_errors do
70
- connection.delete(path.apply(data_source_uuid: data_source_uuid, customer_uuid: uuid))
71
- end
72
- self.invoices = []
73
- end
74
-
75
67
  # Enrichment
76
68
  def tags
77
69
  @attributes[:tags]
@@ -26,6 +26,15 @@ module ChartMogul
26
26
  super(options.merge(customer_uuid: customer_uuid))
27
27
  end
28
28
 
29
+ def self.destroy_all!(data_source_uuid, customer_uuid)
30
+ path = ChartMogul::ResourcePath.new('v1/data_sources/:data_source_uuid/customers/:customer_uuid/invoices')
31
+ handling_errors do
32
+ connection.delete(path.apply(data_source_uuid: data_source_uuid, customer_uuid: customer_uuid))
33
+ end
34
+ true
35
+ end
36
+
37
+
29
38
  def_delegators :invoices, :each, :[], :<<, :size, :length, :empty?, :first
30
39
 
31
40
  private
@@ -20,7 +20,15 @@ module ChartMogul
20
20
  def opt_string_to_time(value)
21
21
  return value unless value.instance_of?(String)
22
22
 
23
- Time.iso8601(value) rescue Time.rfc2822(value) rescue value
23
+ parse_timestamp(value)
24
+ rescue ArgumentError
25
+ value
26
+ end
27
+
28
+ def parse_timestamp(value)
29
+ Time.iso8601(value)
30
+ rescue ArgumentError
31
+ Time.rfc2822(value)
24
32
  end
25
33
  end
26
34
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ChartMogul
4
- VERSION = '1.6.4'
4
+ VERSION = '1.6.6'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chartmogul-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.4
4
+ version: 1.6.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Petr Kopac
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-08-14 00:00:00.000000000 Z
11
+ date: 2020-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -334,7 +334,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
334
334
  - !ruby/object:Gem::Version
335
335
  version: '0'
336
336
  requirements: []
337
- rubygems_version: 3.0.8
337
+ rubygems_version: 3.1.4
338
338
  signing_key:
339
339
  specification_version: 4
340
340
  summary: Chartmogul API Ruby Client