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

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

.audienceObject



41
42
43
# File 'lib/mad_mimi.rb', line 41

def audience
  MadMimi::Audience.new
end

.authenticationObject

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

.configureObject 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

.mailerObject



45
46
47
# File 'lib/mad_mimi.rb', line 45

def mailer
  MadMimi::Mailer.new
end