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, #timestamp

Instance Method Details

#inspectObject

:nodoc:



1273
1274
1275
# File 'lib/oci8/metadata.rb', line 1273

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

database link name of the synonym translation or nil



1259
1260
1261
1262
# File 'lib/oci8/metadata.rb', line 1259

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

#nameObject

object name of the synonym translation



1254
1255
1256
# File 'lib/oci8/metadata.rb', line 1254

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

#objidObject

object id



1244
1245
1246
# File 'lib/oci8/metadata.rb', line 1244

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

#schema_nameObject

schema name of the synonym translation



1249
1250
1251
# File 'lib/oci8/metadata.rb', line 1249

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

#translated_nameObject

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



1265
1266
1267
1268
1269
1270
1271
# File 'lib/oci8/metadata.rb', line 1265

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