Class Mollom::ContentResponse
In: lib/mollom.rb
Parent: Object

Methods

ham?   new   spam?   to_s   unknown?   unsure?  

Constants

Unknown = 0
Ham = 1
Unsure = 2
Spam = 3

Attributes

quality  [R] 
session_id  [R] 

Public Class methods

This class should only be initialized from within the check_content command.

[Source]

     # 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

Public Instance methods

Is the content Ham?

[Source]

     # File lib/mollom.rb, line 186
186:     def ham?
187:       @spam_response == Ham
188:     end

Is the content Spam?

[Source]

     # 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.

[Source]

     # 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

is the content unknown?

[Source]

     # File lib/mollom.rb, line 196
196:     def unknown?
197:       @spam_response == Unknown
198:     end

is Mollom unsure about the content?

[Source]

     # File lib/mollom.rb, line 191
191:     def unsure?
192:       @spam_response == Unsure
193:     end

[Validate]