Sha256: 39bf7a59f19c9822c264b6f9f583df5febc2f9aad507c648e49c606791a8893b
Contents?: true
Size: 661 Bytes
Versions: 3
Compression:
Stored size: 661 Bytes
Contents
require "ruby-debug" module MonkeyParty class Base include HTTParty base_uri 'http://api.mailchimp.com/1.2/' default_params :output => "xml" def initialize(attrs = {}) attrs.each{ |key, value| self.send("#{key}=", value) } end class << self def get(path, options = {}) #fix the format because Mail Chimp doesn't pass the proper header options[:format] = :xml result = super if result.body =~ /<error /i raise MonkeyParty::Error.parse(result.body) end result end def api_key configatron.mailchimp.api_key end end end end
Version data entries
3 entries across 3 versions & 2 rubygems
Version | Path |
---|---|
dpickett-monkey_party-0.0.3 | lib/monkey_party/base.rb |
dpickett-monkey_party-0.1.0 | lib/monkey_party/base.rb |
monkey_party-0.2.0 | lib/monkey_party/base.rb |