Class: Spam::HamService
- Inherits:
-
Object
- Object
- Spam::HamService
- Includes:
- AkismetMethods
- Defined in:
- app/services/spam/ham_service.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
-
#spam_log ⇒ Object
(also: #target)
Returns the value of attribute spam_log.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(spam_log) ⇒ HamService
constructor
A new instance of HamService.
Methods included from AkismetMethods
Constructor Details
#initialize(spam_log) ⇒ HamService
Returns a new instance of HamService.
9 10 11 12 13 14 15 16 |
# File 'app/services/spam/ham_service.rb', line 9 def initialize(spam_log) @spam_log = spam_log @user = spam_log.user @options = { ip_address: spam_log.source_ip, user_agent: spam_log.user_agent } end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
7 8 9 |
# File 'app/services/spam/ham_service.rb', line 7 def @options end |
#spam_log ⇒ Object Also known as: target
Returns the value of attribute spam_log.
7 8 9 |
# File 'app/services/spam/ham_service.rb', line 7 def spam_log @spam_log end |
Instance Method Details
#execute ⇒ Object
18 19 20 21 22 23 24 |
# File 'app/services/spam/ham_service.rb', line 18 def execute if .submit_ham spam_log.update_attribute(:submitted_as_ham, true) else false end end |