mailchimp_api 1.0.0.pre.0 → 1.0.0.pre.1
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 +4 -4
- data/CHANGELOG.md +1 -0
- data/README.md +7 -1
- data/lib/mailchimp_api/collection_parsers/interest_category.rb +11 -0
- data/lib/mailchimp_api/resources/interest_category.rb +24 -0
- data/lib/mailchimp_api/resources/list.rb +2 -0
- data/lib/mailchimp_api/resources/support/countable.rb +4 -2
- data/lib/mailchimp_api/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8d245b2405f92b674684d1ac51f0839db53b404e2c03e15ec2a6e83a0c74d6d
|
4
|
+
data.tar.gz: 3a10cd629ef44a525ed053870fe25b0ff670df6059e77fd0125d06d3b8145a1e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '01941110419582f86cb09c13fa5e7828cef92decd1c9ffa0f4e4205ca3c0f4e76a3eee6f71f7fdd4f2e943bffe7d6f1f9d6eb6bac1be9e0e95c55284378b14d8'
|
7
|
+
data.tar.gz: e59b628296e0fb9521a80f29d8c619b49384c3a6a6ff5b7be1b6c0226f2349abdafdfa9a6bb9875ed4eb93600f1d5d104bf1f62d3ba4f8040964724a7cd088b4
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -45,7 +45,13 @@ account.with_mailchimp_session { MailchimpAPI::List.all }
|
|
45
45
|
|
46
46
|
## Development
|
47
47
|
|
48
|
-
After checking out the repository, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests.
|
48
|
+
After checking out the repository, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests.
|
49
|
+
|
50
|
+
You can also run `bin/console` for an interactive prompt that will allow you to experiment. You can create a file in the root of the project called `dev-config.yml` and add your API key to it:
|
51
|
+
```
|
52
|
+
api_key: <your-api-key>
|
53
|
+
```
|
54
|
+
This will tell the console to pre-authenticate the Mailchimp session, making it easier to test.
|
49
55
|
|
50
56
|
## Contributing
|
51
57
|
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module MailchimpAPI
|
4
|
+
class InterestCategory < Base
|
5
|
+
extend MailchimpAPI::Support::Countable
|
6
|
+
|
7
|
+
self.collection_parser = CollectionParsers::InterestCategory
|
8
|
+
|
9
|
+
self.prefix = '/3.0/lists/:list_id/'
|
10
|
+
self.element_name = 'interest-category'
|
11
|
+
self.collection_name = 'interest-categories'
|
12
|
+
|
13
|
+
protected
|
14
|
+
|
15
|
+
# Overridden - This resource only accepts updates via PATCH requests, not standard ActiveResource PUT requests
|
16
|
+
def update
|
17
|
+
run_callbacks :update do
|
18
|
+
connection.patch(element_path(prefix_options), encode, self.class.headers).tap do |response|
|
19
|
+
load_attributes_from_response(response)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -2,8 +2,10 @@
|
|
2
2
|
|
3
3
|
module MailchimpAPI::Support
|
4
4
|
module Countable
|
5
|
-
def count
|
6
|
-
|
5
|
+
def count(params = {})
|
6
|
+
all_params = params.deep_merge(params: { fields: 'total_items', count: 0 })
|
7
|
+
|
8
|
+
all(all_params).total_items
|
7
9
|
end
|
8
10
|
end
|
9
11
|
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.
|
4
|
+
version: 1.0.0.pre.1
|
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-01-
|
11
|
+
date: 2019-01-31 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_category.rb
|
181
182
|
- lib/mailchimp_api/collection_parsers/link.rb
|
182
183
|
- lib/mailchimp_api/collection_parsers/list.rb
|
183
184
|
- lib/mailchimp_api/configuration.rb
|
@@ -188,6 +189,7 @@ files:
|
|
188
189
|
- lib/mailchimp_api/resources.rb
|
189
190
|
- lib/mailchimp_api/resources/account_information.rb
|
190
191
|
- lib/mailchimp_api/resources/base.rb
|
192
|
+
- lib/mailchimp_api/resources/interest_category.rb
|
191
193
|
- lib/mailchimp_api/resources/link.rb
|
192
194
|
- lib/mailchimp_api/resources/list.rb
|
193
195
|
- lib/mailchimp_api/resources/support/countable.rb
|