Sha256: 57bc0c770bf007f5f6e5e95de0fd4a314a6df37df4583b2ba6b4132631adf758

Contents?: true

Size: 515 Bytes

Versions: 11

Compression:

Stored size: 515 Bytes

Contents

# minimal class to keep schema and sequence name separate
module PgSync
  class Sequence
    attr_reader :schema, :name, :column

    def initialize(schema, name, column:)
      @schema = schema
      @name = name
      @column = column
    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

11 entries across 11 versions & 1 rubygems

Version Path
pgsync-0.8.0 lib/pgsync/sequence.rb
pgsync-0.7.4 lib/pgsync/sequence.rb
pgsync-0.7.3 lib/pgsync/sequence.rb
pgsync-0.7.2 lib/pgsync/sequence.rb
pgsync-0.7.1 lib/pgsync/sequence.rb
pgsync-0.7.0 lib/pgsync/sequence.rb
pgsync-0.6.8 lib/pgsync/sequence.rb
pgsync-0.6.7 lib/pgsync/sequence.rb
pgsync-0.6.6 lib/pgsync/sequence.rb
pgsync-0.6.5 lib/pgsync/sequence.rb
pgsync-0.6.4 lib/pgsync/sequence.rb