Class: PgSync::Table

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(schema, name) ⇒ Table

Returns a new instance of Table.



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

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

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#schemaObject (readonly)

Returns the value of attribute schema.



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

def schema
  @schema
end

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/pgsync/table.rb', line 15

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

#full_nameObject



11
12
13
# File 'lib/pgsync/table.rb', line 11

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

#hashObject

override hash when overriding eql?



20
21
22
# File 'lib/pgsync/table.rb', line 20

def hash
  [schema, name].hash
end

#to_sObject



24
25
26
# File 'lib/pgsync/table.rb', line 24

def to_s
  full_name
end