Class: Visitor
- Inherits:
-
Object
- Object
- Visitor
- Defined in:
- lib/wp-sessioniser/Visitor.rb
Overview
Visitor
Used to handle Visitor profiles in WPSessioniser
- Category
- Package
-
WPSessioniser
- Author
-
Ryan McCoskrie <[email protected]>
- License
-
MIT License
Instance Attribute Summary collapse
-
#hits ⇒ Object
readonly
Returns the value of attribute hits.
Instance Method Summary collapse
-
#initialize ⇒ Visitor
constructor
A new instance of Visitor.
- #push_hit(page, date) ⇒ Object
Constructor Details
#initialize ⇒ Visitor
Returns a new instance of Visitor.
15 16 17 |
# File 'lib/wp-sessioniser/Visitor.rb', line 15 def initialize @hits = Hash.new end |
Instance Attribute Details
#hits ⇒ Object (readonly)
Returns the value of attribute hits.
13 14 15 |
# File 'lib/wp-sessioniser/Visitor.rb', line 13 def hits @hits end |
Instance Method Details
#push_hit(page, date) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/wp-sessioniser/Visitor.rb', line 19 def push_hit(page, date) if @hits.has_key?(page) @hits[page].push(date) else @hits[page] = [date] end end |