Module: Card::Set::All::Notify
- Extended by:
- Card::Set
- Defined in:
- platypus/tmp/set/gem-defaults/mod028-follow/all/notify.rb,
platypus/tmp/set/gem-defaults/mod028-follow/all/notify/base_views.rb,
platypus/tmp/set/gem-defaults/mod028-follow/all/notify/html_views.rb
Overview
Set: All cards (Notify)
Defined Under Namespace
Constant Summary
Constants included from Helpers
Helpers::SET_PATTERN_TEST_REGEXP
Constants included from Event::Api
Instance Attribute Summary collapse
-
#follower_stash ⇒ Object
Returns the value of attribute follower_stash.
Class Method Summary collapse
Instance Method Summary collapse
-
#event: notify_followers_after_delete ⇒ Object
-
#event: notify_followers_after_save ⇒ Object
-
#event: silence_notifications ⇒ Object
-
#event: stash_followers ⇒ Object
in the delete case we have to calculate the follower_stash beforehand but we can’t pass the follower_stash through the ActiveJob queue.
-
#notable_change? ⇒ Boolean
-
#notify_followers ⇒ Object
-
#silence_notifications? ⇒ Boolean
-
#silent_change? ⇒ Boolean
Methods included from Card::Set
Methods included from I18nScope
Methods included from Registrar
#extended, #finalize_load, #process_base_modules, #register_set
Methods included from Helpers
#format_module, #format_modules, #method_missing, #modules, #pattern_code, #respond_to_missing?, #set_name_parts, #shortname, #underscored_name
Methods included from Card::Set::AdvancedApi
#assign_type, #attachment, #define_set_from_error, #ensure_set, #setting_opts, #stage_method
Methods included from Format
#before, #format, layout_method_name, #view, view_method_name, view_setting_method_name, wrapper_method_name
Methods included from Inheritance
#include_set, #include_set_formats
Methods included from Trait
#card_accessor, #card_reader, #card_writer, #require_field
Methods included from Event::Api
Instance Attribute Details
#follower_stash ⇒ Object
Returns the value of attribute follower_stash.
8 9 10 |
# File 'platypus/tmp/set/gem-defaults/mod028-follow/all/notify.rb', line 8 def follower_stash @follower_stash end |
Class Method Details
.source_location ⇒ Object
7 |
# File 'platypus/tmp/set/gem-defaults/mod028-follow/all/notify.rb', line 7 def self.source_location; "/Users/ethan/dev/decko/gem/mod/follow/set/all/notify.rb"; end |
Instance Method Details
#event: notify_followers_after_delete ⇒ Object
34 35 36 |
# File 'platypus/tmp/set/gem-defaults/mod028-follow/all/notify.rb', line 34 event :notify_followers_after_delete, :integrate, on: :delete, when: :notable_change? do notify_followers end |
#event: notify_followers_after_save ⇒ Object
20 21 22 23 |
# File 'platypus/tmp/set/gem-defaults/mod028-follow/all/notify.rb', line 20 event :notify_followers_after_save, :integrate_with_delay, on: :save, priority: 20, when: :notable_change? do notify_followers end |
#event: silence_notifications ⇒ Object
12 13 14 |
# File 'platypus/tmp/set/gem-defaults/mod028-follow/all/notify.rb', line 12 event :silence_notifications, :initialize, when: :silence_notifications? do @silent_change = true end |
#event: stash_followers ⇒ Object
in the delete case we have to calculate the follower_stash beforehand but we can’t pass the follower_stash through the ActiveJob queue. We have to deal with the notifications in the integrate phase instead of the integrate_with_delay phase
29 30 31 32 |
# File 'platypus/tmp/set/gem-defaults/mod028-follow/all/notify.rb', line 29 event :stash_followers, :store, on: :delete, when: :notable_change? do act_card.follower_stash ||= FollowerStash.new act_card.follower_stash.check_card self end |
#notable_change? ⇒ Boolean
45 46 47 48 |
# File 'platypus/tmp/set/gem-defaults/mod028-follow/all/notify.rb', line 45 def notable_change? !silent_change? && current_act_card? && (Card::Auth.current_id != WagnBotID) && followable? end |
#notify_followers ⇒ Object
38 39 40 41 42 43 |
# File 'platypus/tmp/set/gem-defaults/mod028-follow/all/notify.rb', line 38 def notify_followers return unless (act = Card::Director.act) act.reload notify_followers_of act end |
#silence_notifications? ⇒ Boolean
16 17 18 |
# File 'platypus/tmp/set/gem-defaults/mod028-follow/all/notify.rb', line 16 def silence_notifications? !(Card::Env.controller || force_notifications) end |
#silent_change? ⇒ Boolean
50 51 52 |
# File 'platypus/tmp/set/gem-defaults/mod028-follow/all/notify.rb', line 50 def silent_change? silent_change end |