Class: PgSync::Sequence

Inherits:
Object
  • Object
show all
Defined in:
lib/pgsync/sequence.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(schema, name, column:) ⇒ Sequence

Returns a new instance of Sequence.



6
7
8
9
10
# File 'lib/pgsync/sequence.rb', line 6

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

Instance Attribute Details

#columnObject (readonly)

Returns the value of attribute column.



4
5
6
# File 'lib/pgsync/sequence.rb', line 4

def column
  @column
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/pgsync/sequence.rb', line 4

def name
  @name
end

#schemaObject (readonly)

Returns the value of attribute schema.



4
5
6
# File 'lib/pgsync/sequence.rb', line 4

def schema
  @schema
end

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/pgsync/sequence.rb', line 16

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

#full_nameObject



12
13
14
# File 'lib/pgsync/sequence.rb', line 12

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

#hashObject

override hash when overriding eql?



21
22
23
# File 'lib/pgsync/sequence.rb', line 21

def hash
  [schema, name].hash
end

#to_sObject



25
26
27
# File 'lib/pgsync/sequence.rb', line 25

def to_s
  full_name
end