Class: BucketCake::Base::Realtime
- Inherits:
-
BucketCake::Base
- Object
- BucketCake::Base
- BucketCake::Base::Realtime
- Includes:
- TimeHelper
- Defined in:
- lib/bucket_cake/base.rb
Direct Known Subclasses
Constant Summary collapse
- DEFAULT_LOOKBACK =
24.hours
- CURSOR_REGEX =
%r{\A\w+/\d{4}/\d{2}/\d{2}/\d{4}\.gz\z}
Instance Attribute Summary collapse
-
#cursor ⇒ Object
readonly
Returns the value of attribute cursor.
Instance Method Summary collapse
- #files ⇒ Object
-
#initialize(cursor) ⇒ Realtime
constructor
A new instance of Realtime.
Methods included from TimeHelper
#assert_time, #hour_cursor, #hour_keys, #minute_cursor
Methods inherited from BucketCake::Base
Constructor Details
#initialize(cursor) ⇒ Realtime
Returns a new instance of Realtime.
71 72 73 74 |
# File 'lib/bucket_cake/base.rb', line 71 def initialize(cursor) raise 'Invalid cursor format!' unless cursor.nil? || cursor =~ CURSOR_REGEX @cursor = cursor || default_cursor end |
Instance Attribute Details
#cursor ⇒ Object (readonly)
Returns the value of attribute cursor.
69 70 71 |
# File 'lib/bucket_cake/base.rb', line 69 def cursor @cursor end |
Instance Method Details
#files ⇒ Object
76 77 78 79 80 |
# File 'lib/bucket_cake/base.rb', line 76 def files @keys = load_keys @cursor = keys.last unless keys.empty? super end |