hominid 2.0.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,44 +1,42 @@
1
1
  module Hominid
2
2
  module Security
3
3
 
4
- # SECURITY RELATED METHODS
5
-
4
+ # Add an API Key to your account. We will generate a new key for you and return it.
5
+ #
6
+ # Parameters:
7
+ # * username (String) = Your Mailchimp account username.
8
+ # * password (String) = Your Mailchimp account password.
9
+ #
10
+ # Returns:
11
+ # A new API Key that can be immediately used.
12
+ #
6
13
  def add_api_key(username, password)
7
- # Add an API Key to your account. We will generate a new key for you and return it.
8
- #
9
- # Parameters:
10
- # username (String) = Your Mailchimp account username.
11
- # password (String) = Your Mailchimp account password.
12
- #
13
- # Returns:
14
- # A new API Key that can be immediately used.
15
- #
16
14
  @chimpApi.call("apikeyAdd", username, password, @config[:api_key])
17
15
  end
18
16
 
17
+ # Retrieve a list of all MailChimp API Keys for this User.
18
+ #
19
+ # Parameters:
20
+ # * username (String) = Your Mailchimp account username.
21
+ # * password (String) = Your Mailchimp account password.
22
+ # * expired (Boolean) = Whether or not to include expired keys, defaults to false.
23
+ #
24
+ # Returns:
25
+ # An array of API keys including:
26
+ # * apikey (String) = The api key that can be used.
27
+ # * created_at (String) = The date the key was created.
28
+ # * expired_at (String) = The date the key was expired.
29
+ #
19
30
  def api_keys(username, password, expired = false)
20
- # Retrieve a list of all MailChimp API Keys for this User.
21
- #
22
- # Parameters:
23
- # username (String) = Your Mailchimp account username.
24
- # password (String) = Your Mailchimp account password.
25
- # expired (Boolean) = Whether or not to include expired keys, defaults to false.
26
- #
27
- # Returns:
28
- # An array of API keys including:
29
- # apikey (String) = The api key that can be used.
30
- # created_at (String) = The date the key was created.
31
- # expired_at (String) = The date the key was expired.
32
- #
33
31
  @chimpApi.call("apikeys", username, password, @config[:api_key], expired)
34
32
  end
35
33
 
34
+ # Expire a Specific API Key.
35
+ #
36
+ # Returns:
37
+ # True if successful, error code if not.
38
+ #
36
39
  def expire_api_key(username, password)
37
- # Expire a Specific API Key.
38
- #
39
- # Returns:
40
- # True if successful, error code if not.
41
- #
42
40
  @chimpApi.call("apikeyExpire", username, password, @config[:api_key])
43
41
  end
44
42
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hominid
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Getting
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-12-17 00:00:00 -08:00
13
+ date: 2010-02-06 00:00:00 -08:00
14
14
  default_executable:
15
15
  dependencies: []
16
16
 
@@ -22,11 +22,11 @@ extensions: []
22
22
 
23
23
  extra_rdoc_files:
24
24
  - LICENSE
25
- - README.textile
25
+ - README.rdoc
26
26
  files:
27
27
  - .gitignore
28
28
  - LICENSE
29
- - README.textile
29
+ - README.rdoc
30
30
  - Rakefile
31
31
  - VERSION
32
32
  - hominid.gemspec
@@ -1,118 +0,0 @@
1
- h1. Hominid
2
-
3
- Hominid is a Ruby gem that provides a wrapper for interacting with the "Mailchimp":http://eepurl.com/ew8J email marketing service API ("version 1.2":http://www.mailchimp.com/api/1.2/).
4
-
5
- h2. Installation
6
-
7
- <pre><code>sudo gem install hominid</code></pre>
8
-
9
- Hominid is hosted at "Gemcutter":http://gemcutter.org. Be sure that you have the Gemcutter gem installed if you are having trouble installing Hominid:
10
-
11
- <pre><code>sudo gem install gemcutter</code></pre>
12
-
13
- h2. Requirements
14
-
15
- You will need a "Mailchimp":http://eepurl.com/ew8J account. Once you have your Mailchimp account set up, you will need to "generate an API key":http://admin.mailchimp.com/account/api/ in order to get started using Hominid.
16
-
17
- h2. Usage
18
-
19
- Hominid is intended to be a complete Ruby wrapper for working with the Mailchimp API. As of release 2.0.2, all methods available from the Mailchimp API (Version 1.2) are available. Please note in order to use some methods you will need to have "A.I.M. Reports":https://admin.mailchimp.com/account/addons installed on your Mailchimp account.
20
-
21
- You will need to pass your Mailchimp API key to get started:
22
-
23
- <pre><code>h = Hominid::Base.new({:api_key => API_KEY})</code></pre>
24
-
25
- You can also pass in any other config options that you would like to change from the defaults. Take a look at @Hominid::Base@ to see what the default values are.
26
-
27
- Once you have created a Hominid object, you can begin interacting with the Mailchimp account that your API key is associated with.
28
-
29
- h3. Working with Lists
30
-
31
- We have provided some finder methods to make working with your mailing lists easier:
32
-
33
- <pre><code>lists = h.lists
34
- list = h.find_list_by_name("Mailing List Name")
35
- list = h.find_list_by_id("List ID")
36
- list = h.find_list_by_web_id("List Web ID")</code></pre>
37
-
38
- There are also finders for easily getting at List ID's, which are required for nearly all the list methods:
39
-
40
- <pre><code>list_id = h.find_list_id_by_name("Mailing List Name")
41
- list_id_ = h.find_list_id_by_web_id("List Web ID")</code></pre>
42
-
43
- This means that you can _(for example)_ subscribe someone to a particular mailing list:
44
-
45
- <pre><code>h.subscribe(h.find_list_id_by_name("Mailing List Name"), "email@domain.com", {:FNAME => "Bob", :LNAME => "Smith"}, {:email_type => 'html'})</code></pre>
46
-
47
- Or to update a subscriber to a particular list:
48
-
49
- <pre><code>h.update_member(h.find_list_id_by_name("Mailing List Name"), "old_email@domain.com", {:EMAIL => "new_email_@domain.com"}, 'html')</code></pre>
50
-
51
- Take a look at @Hominid::List@ to see the methods that are available for interacting with your lists.
52
-
53
- h3. Working with Campaigns
54
-
55
- We have provided some finder methods to make working with your campaigns easier:
56
-
57
- <pre><code>campaigns = h.campaigns
58
- campaigns = h.find_campaigns_by_list_name("Mailing List Name")
59
- campaigns = h.find_campaigns_by_list_id("Mailing List ID")
60
- campaigns = h.find_campaigns_by_type("regular")
61
- campaign = h.find_campaign_by_id("Campaign ID")
62
- campaign = h.find_campaign_by_title("Campaign Title")</code></pre>
63
-
64
- To create a new campaign, use the @create_campaign@ method:
65
-
66
- <pre><code>new_campaign = h.create_campaign(...)</code></pre>
67
-
68
- Take a look at @Hominid::Campaign@ to see the methods that are available for interacting with your campaigns.
69
-
70
- h3. Mailchimp Helper Methods
71
-
72
- There are a series of helper methods that are also made available with the Hominid gem. For example, to retrieve information about the Mailchimp account associated with your API key, simply:
73
-
74
- <pre><code>account_details_ = h.account_details</code></pre>
75
-
76
- In this case, the @account_details@ object can be accessed like:
77
-
78
- <pre><code>account_details.contact.company
79
- account_details.orders</code></pre>
80
-
81
- Take a look at @Hominid::Helper@ to see the helper methods that are available.
82
-
83
- h3. Mailchimp Security Methods
84
-
85
- There are a couple of security methods that are also made available with the Hominid gem. These are primarily used for dealing with API keys, and require your Mailchimp account username and password:
86
-
87
- <pre><code>h.api_keys('username', 'password')</code></pre>
88
-
89
- Take a look at @Hominid::Security@ to see the security methods that are available.
90
-
91
- h2. Contributors
92
-
93
- Hominid is maintained by "Brian Getting":http://terra-firma-design.com. A very special thank-you to "Michael Strüder":http://github.com/mikezter for all of his hard work. Also, Hominid wouldn't be anywhere near as awesome as it is today without fantastic contributions and inspiration from:
94
-
95
- * "Alan Harper":http://github.com/aussiegeek
96
- * "Will":http://github.com/willinfront
97
- * "Ben Woosley":http://github.com/Empact
98
- * "banker":http://github.com/banker
99
- * "Kristoffer Renholm":http://github.com/renholm
100
- * "Wiktor Schmidt":http://github.com/netguru
101
- * "ron":http://github.com/ron
102
- * "Matthew Carlson":http://mandarinsoda.com/
103
- * "Kelly Mahan":http://digimedia.com/
104
- * "C.G. Brown":http://www.projectlocker.com/
105
- * "Bill Abney":http://github.com/babney
106
- * "David Rice":http://github.com/davidjrice
107
-
108
- h2. Note on Patches/Pull Requests
109
-
110
- # Fork the project.
111
- # Make your feature addition or bug fix.
112
- # Add tests for it. This is important so I don't break it in a future version unintentionally.
113
- # Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
114
- # Send me a pull request. Bonus points for topic branches.
115
-
116
- h2. Copyright
117
-
118
- Copyright (c) 2009 Brian Getting. See LICENSE for details.