Class: PgExport::CompressedDump
Constant Summary
Constants inherited
from Dump::Base
Dump::Base::CHUNK_SIZE
Instance Method Summary
collapse
Methods inherited from Dump::Base
#initialize, #read_chunk, #to_s
#size_human
Instance Method Details
#ext ⇒ Object
7
8
9
|
# File 'lib/pg_export/entities/compressed_dump.rb', line 7
def ext
'.gz'
end
|
#name ⇒ Object
3
4
5
|
# File 'lib/pg_export/entities/compressed_dump.rb', line 3
def name
'Compressed Dump'
end
|
#open(operation_type, &block) ⇒ Object
11
12
13
14
15
16
17
|
# File 'lib/pg_export/entities/compressed_dump.rb', line 11
def open(operation_type, &block)
case operation_type.to_sym
when :read then Zlib::GzipReader.open(path, &block)
when :write then Zlib::GzipWriter.open(path, &block)
else raise ArgumentError, 'Operation type can be only :read or :write'
end
end
|