| Class | Mollom::ContentResponse |
| In: |
lib/mollom.rb
|
| Parent: | Object |
| Unknown | = | 0 |
| Ham | = | 1 |
| Unsure | = | 2 |
| Spam | = | 3 |
| quality | [R] | |
| session_id | [R] |
This class should only be initialized from within the check_content command.
# File lib/mollom.rb, line 174
174: def initialize(hash)
175: @spam_response = hash["spam"]
176: @session_id = hash["session_id"]
177: @quality = hash["quality"]
178: end
Is the content Ham?
# File lib/mollom.rb, line 186
186: def ham?
187: @spam_response == Ham
188: end
Is the content Spam?
# File lib/mollom.rb, line 181
181: def spam?
182: @spam_response == Spam
183: end
Returns ‘unknown’, ‘ham’, ‘unsure’ or ‘spam’, depending on what the content is.
# File lib/mollom.rb, line 201
201: def to_s
202: case @spam_response
203: when Unknown: 'unknown'
204: when Ham: 'ham'
205: when Unsure: 'unsure'
206: when Spam: 'spam'
207: end
208: end