Class: QualifiedName

Inherits:
Object
  • Object
show all
Defined in:
lib/pgcp/qualified_name.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(schema_name, table_name = nil) ⇒ QualifiedName

Returns a new instance of QualifiedName.



4
5
6
7
8
9
10
11
12
# File 'lib/pgcp/qualified_name.rb', line 4

def initialize(schema_name, table_name=nil)
  if table_name.nil?
    @table_name = schema_name.split('.')[1]
    @schema_name = schema_name.split('.')[0]
  else
    @schema_name = schema_name
    @table_name = table_name
  end
end

Instance Attribute Details

#schema_nameObject

Returns the value of attribute schema_name.



2
3
4
# File 'lib/pgcp/qualified_name.rb', line 2

def schema_name
  @schema_name
end

#table_nameObject

Returns the value of attribute table_name.



2
3
4
# File 'lib/pgcp/qualified_name.rb', line 2

def table_name
  @table_name
end

Instance Method Details

#full_nameObject



14
15
16
# File 'lib/pgcp/qualified_name.rb', line 14

def full_name
  "#{@schema_name}.#{@table_name}"
end