Class: GroongaDelta::LocalReader
- Inherits:
-
Object
- Object
- GroongaDelta::LocalReader
- Defined in:
- lib/groonga-delta/local-reader.rb
Defined Under Namespace
Modules: Loggable Classes: PackedSchemaTarget, PackedTableTarget, SchemaTarget, TableTarget
Instance Method Summary collapse
- #build_time(year, month, day, hour = 0, minute = 0, second = 0, nanosecond = 0) ⇒ Object
- #each(min_timestamp = nil, max_timestamp = nil, &block) ⇒ Object
-
#initialize(logger, dir) ⇒ LocalReader
constructor
A new instance of LocalReader.
Constructor Details
#initialize(logger, dir) ⇒ LocalReader
Returns a new instance of LocalReader.
25 26 27 28 |
# File 'lib/groonga-delta/local-reader.rb', line 25 def initialize(logger, dir) @logger = logger @dir = dir end |
Instance Method Details
#build_time(year, month, day, hour = 0, minute = 0, second = 0, nanosecond = 0) ⇒ Object
39 40 41 42 43 44 45 46 47 |
# File 'lib/groonga-delta/local-reader.rb', line 39 def build_time(year, month, day, hour=0, minute=0, second=0, nanosecond=0) Time.utc(year, month, day, hour, minute, Rational(second * 1_000_000_000 + nanosecond, 1_000_000_000)) end |
#each(min_timestamp = nil, max_timestamp = nil, &block) ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'lib/groonga-delta/local-reader.rb', line 30 def each(=nil, =nil, &block) unless block_given? return to_enum(__method__, , ) end targets = list_targets(@dir, , ) targets.sort_by(&:timestamp).each(&block) end |