Class: Minuteman::TimeSpan
- Inherits:
-
Object
- Object
- Minuteman::TimeSpan
- Includes:
- BitOperations
- Defined in:
- lib/minuteman/time_span.rb
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.
-
#redis ⇒ Object
readonly
Returns the value of attribute redis.
Instance Method Summary collapse
-
#initialize(redis, event_name, date) ⇒ TimeSpan
constructor
Public: Initializes the base TimeSpan class.
Methods included from BitOperations
#&, #-, #-@, #^, #include?, #length, #reset, #|
Constructor Details
#initialize(redis, event_name, date) ⇒ TimeSpan
Public: Initializes the base TimeSpan class
redis - The Redis connection
event_name - The event to be tracked
date - A given Time object
18 19 20 21 |
# File 'lib/minuteman/time_span.rb', line 18 def initialize(redis, event_name, date) @redis = redis @key = build_key(event_name, time_format(date)) end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
7 8 9 |
# File 'lib/minuteman/time_span.rb', line 7 def key @key end |
#redis ⇒ Object (readonly)
Returns the value of attribute redis.
7 8 9 |
# File 'lib/minuteman/time_span.rb', line 7 def redis @redis end |