mailchimp_api 1.0.0.pre.2 → 1.0.0.pre.3

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: 861069add26add96360f69d78b31d0f895980aa33b956f5d5ace88d7bdb3afdd
4
- data.tar.gz: 8e85ae7c3ea13a48b4a5274348ee8588a83ecafbd433a086bc0303a74f072252
3
+ metadata.gz: 76805822022f1da1a8eacd1834b33b1b200ea2beabaed4cd5016dbdd70f6de28
4
+ data.tar.gz: ebda6362eb0c1adfbb45a23a9bd2e97ebf056386ceeaa3c75c13596cb47ae1a3
5
5
  SHA512:
6
- metadata.gz: 8919d1a4739dd1fcad7e6ce6bf5b02a15bf0ed4d096937bcabc1c8cd505ac9581d0ae7783299ba063056066dae9279e4ac3fb17dc76b3f47ed99302ea20d19a8
7
- data.tar.gz: e32c9581735b61b05ccfad1b4297b50ae10086e563d03824c015b0d0570e3e7fcdd6414bcb833f4199e3efcca8eecac9417d3cf57b060050c13b38e39c844557
6
+ metadata.gz: c2b01d96e1f90427a78736ad4ec1e9f28efc64cbd5f72065d676850a73416ec790c0a8f4622842c0cbfa774c99dbc00b1b447272f32228977932ace7da383299
7
+ data.tar.gz: d0eaaf838a6396d538fb3a3673fbad6516e9706cabe2bd31fac8c5ef824058327e48615c8e08b124ef5988182914805b67f41f809508e0716f7b7c74596e1964
data/CHANGELOG.md CHANGED
@@ -6,5 +6,6 @@
6
6
  - Support of `/`
7
7
  - Support of `/lists`
8
8
  - Support of '/lists/<id>/interest-categories'
9
+ - Support of 'lists/<id>/interest-categories/<id>/interests'
9
10
  - Support of '/lists/<id>/members'
10
11
  - `.count` support
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MailchimpAPI::CollectionParsers
4
+ class Interest < Base
5
+ end
6
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MailchimpAPI
4
+ class Interest < Base
5
+ extend MailchimpAPI::Support::Countable
6
+
7
+ include MailchimpAPI::Support::PatchUpdate
8
+
9
+ self.collection_parser = CollectionParsers::Interest
10
+
11
+ self.prefix = '/3.0/lists/:list_id/interest-categories/:interest_category_id/'
12
+ end
13
+ end
@@ -11,5 +11,15 @@ module MailchimpAPI
11
11
  self.prefix = '/3.0/lists/:list_id/'
12
12
  self.element_name = 'interest-category'
13
13
  self.collection_name = 'interest-categories'
14
+
15
+ # The path to get interests is '/3.0/lists/:list_id/interest-categories/:interest_category_id'
16
+ # Unfortunately, ActiveResource does not support nested resources, only single parent resources:
17
+ #
18
+ # https://github.com/rails/activeresource/blob/4accda8bc03ceae0ad626f8cec0b4751e89a58ad/lib/active_resource/associations.rb#L151
19
+ #
20
+ # Using a has_many, there is no way to include the `list_id`, so we just create our own interests method.
21
+ def interests
22
+ @interests ||= MailchimpAPI::Interest.find(:all, params: { interest_category_id: id }.merge(prefix_options))
23
+ end
14
24
  end
15
25
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MailchimpAPI
4
- VERSION = '1.0.0.pre.2'
4
+ VERSION = '1.0.0.pre.3'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailchimp_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre.2
4
+ version: 1.0.0.pre.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - rewind.io
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-04 00:00:00.000000000 Z
11
+ date: 2019-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activeresource
@@ -178,6 +178,7 @@ files:
178
178
  - lib/mailchimp_api.rb
179
179
  - lib/mailchimp_api/collection_parsers.rb
180
180
  - lib/mailchimp_api/collection_parsers/base.rb
181
+ - lib/mailchimp_api/collection_parsers/interest.rb
181
182
  - lib/mailchimp_api/collection_parsers/interest_category.rb
182
183
  - lib/mailchimp_api/collection_parsers/link.rb
183
184
  - lib/mailchimp_api/collection_parsers/list.rb
@@ -190,6 +191,7 @@ files:
190
191
  - lib/mailchimp_api/resources.rb
191
192
  - lib/mailchimp_api/resources/account_information.rb
192
193
  - lib/mailchimp_api/resources/base.rb
194
+ - lib/mailchimp_api/resources/interest.rb
193
195
  - lib/mailchimp_api/resources/interest_category.rb
194
196
  - lib/mailchimp_api/resources/link.rb
195
197
  - lib/mailchimp_api/resources/list.rb