Module: MadMimi
- Defined in:
- lib/mad_mimi.rb,
lib/mad_mimi/config.rb,
lib/mad_mimi/mailer.rb,
lib/mad_mimi/request.rb,
lib/mad_mimi/version.rb,
lib/mad_mimi/audience.rb
Overview
:nodoc
Defined Under Namespace
Modules: Request Classes: Audience, Config, Mailer
Constant Summary collapse
- VERSION =
"0.0.3"
Class Method Summary collapse
- .api_url(ssl = false) ⇒ Object
- .audience ⇒ Object
-
.authentication ⇒ Object
Authentication hash.
-
.configure ⇒ Object
(also: config)
Sets the Mad Mimi configuration options.
- .mailer ⇒ Object
Class Method Details
.api_url(ssl = false) ⇒ Object
37 38 39 |
# File 'lib/mad_mimi.rb', line 37 def api_url(ssl = false) "#{ssl ? 'https' : 'http'}://api.madmimi.com" end |
.audience ⇒ Object
41 42 43 |
# File 'lib/mad_mimi.rb', line 41 def audience MadMimi::Audience.new end |
.authentication ⇒ Object
Authentication hash
return [Hash]
30 31 32 33 34 35 |
# File 'lib/mad_mimi.rb', line 30 def authentication { :username => configure.username, :api_key => configure.api_key } end |
.configure ⇒ Object Also known as: config
Sets the Mad Mimi configuration options. Best used by passing a block.
Example:
MadMimi.configure do |config|
config.username = "YourMadMimiEmailAddress"
config.api_key = "YourMadMimiApiKey"
end
Returns:
The MadMimi Config
singleton instance.
21 22 23 24 |
# File 'lib/mad_mimi.rb', line 21 def configure config = MadMimi::Config.instance block_given? ? yield(config) : config end |