Class: KMDB::Dumpfile
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- KMDB::Dumpfile
- Includes:
- CustomRecord
- Defined in:
- lib/kmdb/models/dumpfile.rb
Overview
Remembers which JSON files where imported, and up to which point.
Class Method Summary collapse
Instance Method Summary collapse
Methods included from CustomRecord
Class Method Details
.get(revision) ⇒ Object
29 30 31 |
# File 'lib/kmdb/models/dumpfile.rb', line 29 def self.get(revision) find_or_create(revision: revision) end |
Instance Method Details
#complete? ⇒ Boolean
24 25 26 27 |
# File 'lib/kmdb/models/dumpfile.rb', line 24 def complete? return if offset.nil? || length.nil? offset >= length end |
#file ⇒ Object
20 21 22 |
# File 'lib/kmdb/models/dumpfile.rb', line 20 def file JsonFile.new(revision) end |
#offset ⇒ Object
16 17 18 |
# File 'lib/kmdb/models/dumpfile.rb', line 16 def offset attributes['offset'] || 0 end |
#set(offset) ⇒ Object
12 13 14 |
# File 'lib/kmdb/models/dumpfile.rb', line 12 def set(offset) update_attributes!(offset: offset) end |