Class: Counterman::TimeSpan
- Inherits:
-
Object
- Object
- Counterman::TimeSpan
- Includes:
- HashOperations
- Defined in:
- lib/counterman/time_span.rb
Overview
Public: The timespan class. All the time span classes inherit from this one
Constant Summary collapse
- DATE_FORMAT =
"%s-%02d-%02d"
- TIME_FORMAT =
"%02d:%02d"
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
Instance Method Summary collapse
-
#initialize(event_name, date) ⇒ TimeSpan
constructor
Public: Initializes the base TimeSpan class.
Methods included from HashOperations
#all_counts, #count, #count_all
Constructor Details
#initialize(event_name, date) ⇒ TimeSpan
Public: Initializes the base TimeSpan class
event_name - The event to be tracked
date - A given Time object
21 22 23 |
# File 'lib/counterman/time_span.rb', line 21 def initialize(event_name, date) @key = build_key(event_name, time_format(date)) end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
11 12 13 |
# File 'lib/counterman/time_span.rb', line 11 def key @key end |