Class: OCI8::Metadata::Synonym

Inherits:
Base
  • Object
show all
Defined in:
lib/oci8/metadata.rb

Overview

Metadata for a synonym.

This is returned by:

  • OCI8#describe_any(name)

  • OCI8#describe_synonym(name)

  • OCI8::Metadata::Schema#all_objects

  • OCI8::Metadata::Schema#objects

Instance Method Summary collapse

Methods inherited from Base

#obj_id, #obj_name, #obj_schema

Instance Method Details

#inspectObject

:nodoc:



1317
1318
1319
# File 'lib/oci8/metadata.rb', line 1317

def inspect # :nodoc:
  "#<#{self.class.name}:(#{obj_id}) #{obj_schema}.#{obj_name}>"
end

database link name of the synonym translation or nil



1303
1304
1305
1306
# File 'lib/oci8/metadata.rb', line 1303

def link
  @link ||= attr_get_string(OCI_ATTR_LINK)
  @link.size == 0 ? nil : @link
end

#nameObject

object name of the synonym translation



1298
1299
1300
# File 'lib/oci8/metadata.rb', line 1298

def name
  @name ||= attr_get_string(OCI_ATTR_NAME)
end

#objidObject

object id



1288
1289
1290
# File 'lib/oci8/metadata.rb', line 1288

def objid
  @objid ||= attr_get_ub4(OCI_ATTR_OBJID)
end

#schema_nameObject

schema name of the synonym translation



1293
1294
1295
# File 'lib/oci8/metadata.rb', line 1293

def schema_name
  @schema_name ||= attr_get_string(OCI_ATTR_SCHEMA_NAME)
end

#translated_nameObject

full-qualified synonym translation name with schema, object and database link name.



1309
1310
1311
1312
1313
1314
1315
# File 'lib/oci8/metadata.rb', line 1309

def translated_name
  if link.nil?
    schema_name + '.' + name
  else
    schema_name + '.' + name + '@' + link
  end
end