Class: Checker

Inherits:
Object
  • Object
show all
Defined in:
lib/burnspam/point_tracker.rb

Overview

Checker calls the methods of the strategies and holds the results in accessible instance variables. The results are either Integer or Boolean

Version

0.1.1

Date

2011/12/18

@author

Brian Burns, x10205284

@reference

snook.ca/archives/other/effective_blog_comment_spam_blocker

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(strategy) ⇒ Checker

Returns a new instance of Checker.



108
109
110
111
112
113
114
115
116
# File 'lib/burnspam/point_tracker.rb', line 108

def initialize(strategy)
  @count_urls = strategy.count_urls
  @url_length = strategy.url_length
  @length = strategy.length
  @starts_with = strategy.starts_with?
  @duplicate = strategy.duplicate?
  @test = strategy.test
  @keyword_count = strategy.keywords
end

Instance Attribute Details

#count_urlsObject (readonly)

Returns the value of attribute count_urls.



105
106
107
# File 'lib/burnspam/point_tracker.rb', line 105

def count_urls
  @count_urls
end

#duplicateObject (readonly)

Returns the value of attribute duplicate.



105
106
107
# File 'lib/burnspam/point_tracker.rb', line 105

def duplicate
  @duplicate
end

#keyword_countObject (readonly)

Returns the value of attribute keyword_count.



105
106
107
# File 'lib/burnspam/point_tracker.rb', line 105

def keyword_count
  @keyword_count
end

#lengthObject (readonly)

Returns the value of attribute length.



105
106
107
# File 'lib/burnspam/point_tracker.rb', line 105

def length
  @length
end

#starts_withObject (readonly)

Returns the value of attribute starts_with.



105
106
107
# File 'lib/burnspam/point_tracker.rb', line 105

def starts_with
  @starts_with
end

#testObject (readonly)

Returns the value of attribute test.



105
106
107
# File 'lib/burnspam/point_tracker.rb', line 105

def test
  @test
end

#url_lengthObject (readonly)

Returns the value of attribute url_length.



105
106
107
# File 'lib/burnspam/point_tracker.rb', line 105

def url_length
  @url_length
end