Sha256: e39547033f6968102f2259345dc585c95bb35b616a70b20d2ad16e923e6b20ab

Contents?: true

Size: 468 Bytes

Versions: 15

Compression:

Stored size: 468 Bytes

Contents

# minimal class to keep schema and table name separate
module PgSync
  class Table
    attr_reader :schema, :name

    def initialize(schema, name)
      @schema = schema
      @name = name
    end

    def full_name
      "#{schema}.#{name}"
    end

    def eql?(other)
      other.schema == schema && other.name == name
    end

    # override hash when overriding eql?
    def hash
      [schema, name].hash
    end

    def to_s
      full_name
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
pgsync-0.8.0 lib/pgsync/table.rb
pgsync-0.7.4 lib/pgsync/table.rb
pgsync-0.7.3 lib/pgsync/table.rb
pgsync-0.7.2 lib/pgsync/table.rb
pgsync-0.7.1 lib/pgsync/table.rb
pgsync-0.7.0 lib/pgsync/table.rb
pgsync-0.6.8 lib/pgsync/table.rb
pgsync-0.6.7 lib/pgsync/table.rb
pgsync-0.6.6 lib/pgsync/table.rb
pgsync-0.6.5 lib/pgsync/table.rb
pgsync-0.6.4 lib/pgsync/table.rb
pgsync-0.6.3 lib/pgsync/table.rb
pgsync-0.6.2 lib/pgsync/table.rb
pgsync-0.6.1 lib/pgsync/table.rb
pgsync-0.6.0 lib/pgsync/table.rb