Module: Maktoub
- Defined in:
- lib/maktoub.rb,
lib/maktoub/engine.rb,
lib/maktoub/version.rb,
app/helpers/maktoub/archives_helper.rb,
app/mailers/maktoub/newsletter_mailer.rb,
app/helpers/maktoub/application_helper.rb,
lib/generators/maktoub/config_generator.rb,
app/controllers/maktoub/archives_controller.rb,
app/controllers/maktoub/application_controller.rb,
app/controllers/maktoub/subscribers_controller.rb
Defined Under Namespace
Modules: ApplicationHelper, ArchivesHelper, Generators Classes: ApplicationController, ArchivesController, Engine, NewsletterMailer, SubscribersController
Constant Summary collapse
- VERSION =
"0.2.5"
Class Attribute Summary collapse
-
.app_name ⇒ Object
Returns the value of attribute app_name.
- .email_field ⇒ Object
-
.facebook_url ⇒ Object
Returns the value of attribute facebook_url.
-
.from ⇒ Object
Returns the value of attribute from.
-
.google_plus_url ⇒ Object
Returns the value of attribute google_plus_url.
-
.home_domain ⇒ Object
Returns the value of attribute home_domain.
-
.logo ⇒ Object
Returns the value of attribute logo.
- .name_field ⇒ Object
-
.subscription_preferences_url ⇒ Object
Returns the value of attribute subscription_preferences_url.
-
.twitter_url ⇒ Object
Returns the value of attribute twitter_url.
-
.unsubscribe_method ⇒ Object
Returns the value of attribute unsubscribe_method.
Class Method Summary collapse
- .home_url ⇒ Object
- .subscribers ⇒ Object
- .subscribers_extractor(&block) ⇒ Object
- .unsubscribe(email) ⇒ Object
Class Attribute Details
.app_name ⇒ Object
Returns the value of attribute app_name.
5 6 7 |
# File 'lib/maktoub.rb', line 5 def app_name @app_name end |
.email_field ⇒ Object
17 18 19 |
# File 'lib/maktoub.rb', line 17 def email_field @email_field || :email end |
.facebook_url ⇒ Object
Returns the value of attribute facebook_url.
5 6 7 |
# File 'lib/maktoub.rb', line 5 def facebook_url @facebook_url end |
.from ⇒ Object
Returns the value of attribute from.
5 6 7 |
# File 'lib/maktoub.rb', line 5 def from @from end |
.google_plus_url ⇒ Object
Returns the value of attribute google_plus_url.
5 6 7 |
# File 'lib/maktoub.rb', line 5 def google_plus_url @google_plus_url end |
.home_domain ⇒ Object
Returns the value of attribute home_domain.
5 6 7 |
# File 'lib/maktoub.rb', line 5 def home_domain @home_domain end |
.logo ⇒ Object
Returns the value of attribute logo.
5 6 7 |
# File 'lib/maktoub.rb', line 5 def logo @logo end |
.name_field ⇒ Object
21 22 23 |
# File 'lib/maktoub.rb', line 21 def name_field @name_field || :name end |
.subscription_preferences_url ⇒ Object
Returns the value of attribute subscription_preferences_url.
5 6 7 |
# File 'lib/maktoub.rb', line 5 def subscription_preferences_url @subscription_preferences_url end |
.twitter_url ⇒ Object
Returns the value of attribute twitter_url.
5 6 7 |
# File 'lib/maktoub.rb', line 5 def twitter_url @twitter_url end |
.unsubscribe_method ⇒ Object
Returns the value of attribute unsubscribe_method.
5 6 7 |
# File 'lib/maktoub.rb', line 5 def unsubscribe_method @unsubscribe_method end |
Class Method Details
.home_url ⇒ Object
41 42 43 |
# File 'lib/maktoub.rb', line 41 def home_url "http://" + home_domain end |
.subscribers ⇒ Object
25 26 27 |
# File 'lib/maktoub.rb', line 25 def subscribers @subscribers.call end |
.subscribers_extractor(&block) ⇒ Object
29 30 31 |
# File 'lib/maktoub.rb', line 29 def subscribers_extractor (&block) @subscribers = Proc.new &block end |
.unsubscribe(email) ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/maktoub.rb', line 33 def unsubscribe(email) subscribers.select do |s| s.send(email_field) == email end.each do |s| s.send(unsubscribe_method) if unsubscribe_method end end |