Class: Backup::Splitter

Inherits:
Object
  • Object
show all
Includes:
CLI::Helpers
Defined in:
lib/backup/splitter.rb

Constant Summary

Constants included from CLI::Helpers

CLI::Helpers::UTILITY

Instance Method Summary collapse

Constructor Details

#initialize(model, chunk_size) ⇒ Splitter

Returns a new instance of Splitter.



7
8
9
10
# File 'lib/backup/splitter.rb', line 7

def initialize(model, chunk_size)
  @model = model
  @chunk_size = chunk_size
end

Instance Method Details

#split_with {|@split_command| ... } ⇒ Object

This is called as part of the procedure used to build the final backup package file(s). It yields it’s portion of the command line for this procedure, which will split the data being piped into it into multiple files, based on the @chunk_size. Once the packaging procedure is complete, it will return and

Yields:

  • (@split_command)


19
20
21
22
23
# File 'lib/backup/splitter.rb', line 19

def split_with
  before_packaging
  yield @split_command
  after_packaging
end