lib/active_esp/subscriber.rb in active_esp-0.1.0.alpha1 vs lib/active_esp/subscriber.rb in active_esp-0.1.0.alpha2

- old
+ new

@@ -104,23 +104,35 @@ return true end # Accessing commonly used API calls + def create! + raise ActiveESP::ProviderNotConfiguredException unless ActiveESP.provider + ActiveESP.provider.create_subscriber(self) + end + # Add the subscriber to the provider and optionally subscribe them to the # given list. # # @see ActiveESP::Providers::Interface#subscribe def subscribe!(list = nil) raise ActiveESP::ProviderNotConfiguredException unless ActiveESP.provider - ActiveESP.provider.subscribe(self, list) + ActiveESP.provider.subscribe_to_list(self, list) end # Remove the subscriber from the given list. # # @see ActiveESP::Providers::Interface#unsubscribe def unsubscribe!(list) raise ActiveESP::ProviderNotConfiguredException unless ActiveESP.provider ActiveESP.provider.unsubscribe(self, list) + end + + class << self + def find(params) + raise ActiveESP::ProviderNotConfiguredException unless ActiveESP.provider + ActiveESP.provider.find_subscriber(params) + end end end end