Class: Burnspam
- Inherits:
-
Object
- Object
- Burnspam
- Defined in:
- lib/burnspam.rb
Overview
The program takes a comment input as three paramaters: email, name and content. It performs some basic checks to determine the “spaminess” of a comment. Higher values are better while negative numbers are likely spam.
It also stores the most recent comments in memory and checks that new comments are not duplicates. If a new comment is found already existing in memory, the spaminess value goes down!
- Version
-
0.1.1
- Date
-
2011/12/18
- @author
-
Brian Burns, x10205284
Burnspan.spaminess returns values:
- spaminess < 0
-
Obvious spam
- spaminess 0 - 2
-
Questionable quality
- spaminess > 2
-
Good quality comment
Defined Under Namespace
Classes: PointTracker
Instance Attribute Summary collapse
-
#points ⇒ Object
readonly
Returns the value of attribute points.
Instance Method Summary collapse
-
#initialize(email, name, content) ⇒ Burnspam
constructor
Analyse the comment.
-
#spaminess ⇒ Object
Return an int value of spaminess.
Constructor Details
#initialize(email, name, content) ⇒ Burnspam
Analyse the comment
27 28 29 |
# File 'lib/burnspam.rb', line 27 def initialize(email, name, content) @points = PointTracker.new(email, name, content) end |
Instance Attribute Details
#points ⇒ Object (readonly)
Returns the value of attribute points.
24 25 26 |
# File 'lib/burnspam.rb', line 24 def points @points end |
Instance Method Details
#spaminess ⇒ Object
Return an int value of spaminess
32 33 34 |
# File 'lib/burnspam.rb', line 32 def spaminess @points.spaminess end |