Module: ScreeningModel
- Extended by:
- ActiveSupport::Concern
- Included in:
- ScreenedEmail, ScreenedIpAddress, ScreenedUrl
- Defined in:
- lib/screening_model.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
Instance Method Details
#action_name=(arg) ⇒ Object
26 27 28 29 30 31 |
# File 'lib/screening_model.rb', line 26 def action_name=(arg) if arg.nil? || !self.class.actions.has_key?(arg.to_sym) raise ArgumentError.new("Invalid action type #{arg}") end self.action_type = self.class.actions[arg.to_sym] end |
#record_match! ⇒ Object
33 34 35 36 37 |
# File 'lib/screening_model.rb', line 33 def record_match! self.match_count += 1 self.last_match_at = Time.zone.now save end |
#set_default_action ⇒ Object
22 23 24 |
# File 'lib/screening_model.rb', line 22 def set_default_action self.action_type ||= self.class.actions[self.class.df_action] end |