Class: Spam::AkismetMarkAsSpamService
- Inherits:
-
Object
- Object
- Spam::AkismetMarkAsSpamService
- Includes:
- AkismetMethods
- Defined in:
- app/services/spam/akismet_mark_as_spam_service.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
-
#target ⇒ Object
Returns the value of attribute target.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(target:) ⇒ AkismetMarkAsSpamService
constructor
A new instance of AkismetMarkAsSpamService.
Methods included from AkismetMethods
Constructor Details
#initialize(target:) ⇒ AkismetMarkAsSpamService
Returns a new instance of AkismetMarkAsSpamService.
9 10 11 12 |
# File 'app/services/spam/akismet_mark_as_spam_service.rb', line 9 def initialize(target:) @target = target @options = {} end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
7 8 9 |
# File 'app/services/spam/akismet_mark_as_spam_service.rb', line 7 def @options end |
#target ⇒ Object
Returns the value of attribute target.
7 8 9 |
# File 'app/services/spam/akismet_mark_as_spam_service.rb', line 7 def target @target end |
Instance Method Details
#execute ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'app/services/spam/akismet_mark_as_spam_service.rb', line 14 def execute @options[:ip_address] = @target.ip_address @options[:user_agent] = @target.user_agent return unless target.submittable_as_spam? return unless .submit_spam target.user_agent_detail.update_attribute(:submitted, true) end |