Class: ProjectHoneypot::Url
- Inherits:
-
Object
- Object
- ProjectHoneypot::Url
- Defined in:
- lib/project_honeypot/url.rb
Instance Attribute Summary collapse
-
#ip_address ⇒ Object
readonly
Returns the value of attribute ip_address.
-
#last_activity ⇒ Object
readonly
Returns the value of attribute last_activity.
-
#offenses ⇒ Object
readonly
Returns the value of attribute offenses.
-
#score ⇒ Object
readonly
Returns the value of attribute score.
Instance Method Summary collapse
- #comment_spammer? ⇒ Boolean
- #harvester? ⇒ Boolean
-
#initialize(ip_address, honeypot_response) ⇒ Url
constructor
A new instance of Url.
- #safe? ⇒ Boolean
- #suspicious? ⇒ Boolean
Constructor Details
#initialize(ip_address, honeypot_response) ⇒ Url
Returns a new instance of Url.
4 5 6 7 8 |
# File 'lib/project_honeypot/url.rb', line 4 def initialize(ip_address, honeypot_response) @ip_address = ip_address @safe = honeypot_response.nil? process_score(honeypot_response) end |
Instance Attribute Details
#ip_address ⇒ Object (readonly)
Returns the value of attribute ip_address.
3 4 5 |
# File 'lib/project_honeypot/url.rb', line 3 def ip_address @ip_address end |
#last_activity ⇒ Object (readonly)
Returns the value of attribute last_activity.
3 4 5 |
# File 'lib/project_honeypot/url.rb', line 3 def last_activity @last_activity end |
#offenses ⇒ Object (readonly)
Returns the value of attribute offenses.
3 4 5 |
# File 'lib/project_honeypot/url.rb', line 3 def offenses @offenses end |
#score ⇒ Object (readonly)
Returns the value of attribute score.
3 4 5 |
# File 'lib/project_honeypot/url.rb', line 3 def score @score end |
Instance Method Details
#comment_spammer? ⇒ Boolean
14 15 16 |
# File 'lib/project_honeypot/url.rb', line 14 def comment_spammer? @offenses.include?(:comment_spammer) end |
#harvester? ⇒ Boolean
18 19 20 |
# File 'lib/project_honeypot/url.rb', line 18 def harvester? @offenses.include?(:harvester) end |
#safe? ⇒ Boolean
10 11 12 |
# File 'lib/project_honeypot/url.rb', line 10 def safe? @safe end |
#suspicious? ⇒ Boolean
22 23 24 |
# File 'lib/project_honeypot/url.rb', line 22 def suspicious? @offenses.include?(:suspicious) end |