Class: Refinery::Mailchimp::API
- Inherits:
-
Hominid::API
- Object
- Hominid::API
- Refinery::Mailchimp::API
- Defined in:
- lib/refinerycms-mailchimp.rb
Defined Under Namespace
Classes: BadAPIKeyError
Constant Summary collapse
- KeySetting =
{ :name => "mailchimp_api_key", :default => "Set me!" }
- DefaultFromNameSetting =
{ :name => "mailchimp_default_from_name", :default => "" }
- DefaultFromEmailSetting =
{ :name => "mailchimp_default_from_email", :default => "" }
- DefaultToNameSetting =
{ :name => "mailchimp_default_to_name", :default => "" }
Instance Method Summary collapse
-
#initialize ⇒ API
constructor
A new instance of API.
Constructor Details
#initialize ⇒ API
Returns a new instance of API.
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/refinerycms-mailchimp.rb', line 27 def initialize api_key = RefinerySetting.get_or_set KeySetting[:name], KeySetting[:default] raise BadAPIKeyError if api_key.blank? || api_key == KeySetting[:default] begin super api_key rescue ArgumentError raise BadAPIKeyError end end |