Class: StaticDb::Dump

Inherits:
Object
  • Object
show all
Defined in:
lib/static_db/dump.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(static_db_path: StaticDb.path) ⇒ Dump

Returns a new instance of Dump.



5
6
7
8
# File 'lib/static_db/dump.rb', line 5

def initialize(static_db_path: StaticDb.path)
  @static_db_path = Pathname.new(static_db_path)
  @models_to_be_saved = models
end

Instance Attribute Details

#models_to_be_savedObject (readonly)

Returns the value of attribute models_to_be_saved.



3
4
5
# File 'lib/static_db/dump.rb', line 3

def models_to_be_saved
  @models_to_be_saved
end

Instance Method Details

#performObject



10
11
12
13
14
15
16
# File 'lib/static_db/dump.rb', line 10

def perform
  exit 1 if $skip_static_db_dump

  validate_records!
  reset_data_directory!
  dump_data!
end