Class: QualifiedName
- Inherits:
-
Object
- Object
- QualifiedName
- Defined in:
- lib/pgcp/qualified_name.rb
Instance Attribute Summary collapse
-
#schema_name ⇒ Object
Returns the value of attribute schema_name.
-
#table_name ⇒ Object
Returns the value of attribute table_name.
Instance Method Summary collapse
- #full_name ⇒ Object
-
#initialize(schema_name, table_name = nil) ⇒ QualifiedName
constructor
A new instance of QualifiedName.
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_name ⇒ Object
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_name ⇒ Object
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_name ⇒ Object
14 15 16 |
# File 'lib/pgcp/qualified_name.rb', line 14 def full_name "#{@schema_name}.#{@table_name}" end |