Sha256: 7f05c85600f85b2cf9e99224ada44ad49566ddee56d1e852b61824c9a58cc2f3

Contents?: true

Size: 531 Bytes

Versions: 2

Compression:

Stored size: 531 Bytes

Contents

class PgExport
  module Dump
    class Base
      extend Forwardable
      include SizeHuman

      CHUNK_SIZE = (2**16).freeze

      def_delegators :file, :path, :read, :write, :rewind, :size, :eof?

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

      def ext
        raise 'Overwrite it'
      end

      def read_chunk
        raise 'Overwrite it'
      end

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

      private

      attr_reader :file
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pg_export-0.3.1 lib/pg_export/entities/dump/base.rb
pg_export-0.3.0 lib/pg_export/entities/dump/base.rb