amro / uakari

An API wrapper for the MailChimp STS API (1.0)
MIT License
20 stars 5 forks source link

Turned Uakari into a module #5

Closed srbiv closed 13 years ago

srbiv commented 13 years ago

Hopefully this one will work better.

cyu commented 13 years ago

Seems like you can solve this easier like this:

class Uakari
  # whatever was here before...

  def self.api_key(key)
    @@default_instance = new(key)
  end

  def self.send_email(*args)
    @@default_instance.send_email(*args)
  end
end

maybe add some check that an api_key is set before calling send_email

amro commented 13 years ago

I'm going to take Calvin's suggestion so one can create an instance if needed plus some of the stuff you did, Stafford, so Uakari config is DRY. I'll try to make time tonight.

srbiv commented 13 years ago

Cool, sounds good to me. Thanks!

amro commented 13 years ago

Thank you. Sorry for the mixup -- I didn't really understand what Federico was after until just recently.

srbiv commented 13 years ago

No worries, I learned a ton doing this anyway :)

amro commented 13 years ago

So did I (namely how to impl an ActionMailer handler O_O).

amro commented 13 years ago

Just pushed 0.2.3 -- should be good to go. I'll do something similar w/ gibbon as soon as I can. Note that for config, I changed "apikey" to "api_key".