Module: Card::Set::All::Notify

Extended by:
Card::Set
Defined in:
tmpsets/set/mod006-05_email/all/notify.rb

Defined Under Namespace

Classes: FollowerStash

Instance Method Summary collapse

Methods included from Card::Set

abstract_set?, all_set?, card_accessor, card_reader, card_writer, clean_empty_module_from_hash, clean_empty_modules, define_on_format, ensure_set, extended, format, process_base_module_list, process_base_modules, register_set, register_set_format, shortname, stage_method, view, write_tmp_file

Methods included from Event

#define_event, #event

Instance Method Details

#act_cardObject



61
62
63
# File 'tmpsets/set/mod006-05_email/all/notify.rb', line 61

def act_card
  @supercard || self
end

#followable?Boolean

Returns:

  • (Boolean)


65
66
67
# File 'tmpsets/set/mod006-05_email/all/notify.rb', line 65

def followable?
  true
end

#notable_change?Boolean

Returns:

  • (Boolean)


73
74
75
76
# File 'tmpsets/set/mod006-05_email/all/notify.rb', line 73

def notable_change?
  !silent_change? && !supercard && current_act &&
    Card::Auth.current_id != WagnBotID && followable?
end

#notify_followersObject



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'tmpsets/set/mod006-05_email/all/notify.rb', line 96

def notify_followers
  @current_act.reload
  @follower_stash ||= FollowerStash.new
  @current_act.actions.each do |a|
    @follower_stash.add_affected_card a.card if a.card
  end
  @follower_stash.each_follower_with_reason do |follower, reason|
    if follower. && follower != @current_act.actor
      follower..send_change_notice @current_act, reason[:set_card].name,
                                          reason[:option]
    end
  end
# this error handling should apply to all extend callback exceptions
rescue => e
  Rails.logger.info "\nController exception: #{e.message}"
  Card::Error.current = e
  notable_exception_raised
end

#silent_change?Boolean

Returns:

  • (Boolean)


69
70
71
# File 'tmpsets/set/mod006-05_email/all/notify.rb', line 69

def silent_change?
  silent_change.nil? ? !Card::Env[:controller] : silent_change
end