Class: PgExport::Dump::Base

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
SizeHuman
Defined in:
lib/pg_export/entities/dump/base.rb

Direct Known Subclasses

CompressedDump, SqlDump

Constant Summary collapse

CHUNK_SIZE =
(2**16).freeze

Instance Method Summary collapse

Methods included from SizeHuman

#size_human

Constructor Details

#initializeBase

Returns a new instance of Base.



11
12
13
# File 'lib/pg_export/entities/dump/base.rb', line 11

def initialize
  @file = Tempfile.new('dump')
end

Instance Method Details

#extObject



15
16
17
# File 'lib/pg_export/entities/dump/base.rb', line 15

def ext
  raise 'Overwrite it'
end

#read_chunkObject



19
20
21
# File 'lib/pg_export/entities/dump/base.rb', line 19

def read_chunk
  raise 'Overwrite it'
end

#to_sObject



23
24
25
# File 'lib/pg_export/entities/dump/base.rb', line 23

def to_s
  "#{name || self.class} #{file.class} (#{size_human})"
end