Class: OCI8::Metadata::List

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

Overview

internal use only.

Instance Method Summary collapse

Methods inherited from Base

#obj_id, #obj_link, #obj_name, #obj_schema

Instance Method Details

#ltypeObject

Table 6-15 List Attributes



1656
1657
1658
# File 'lib/oci8/metadata.rb', line 1656

def ltype
  attr_get_ub2(OCI_ATTR_LTYPE)
end

#to_aObject

convert to array



1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
# File 'lib/oci8/metadata.rb', line 1661

def to_a
  # Table 6-15 List Attributes
  case ltype
  when OCI_LTYPE_COLUMN;        offset = 1
  when OCI_LTYPE_ARG_PROC;      offset = 1
  when OCI_LTYPE_ARG_FUNC;      offset = 0
  when OCI_LTYPE_SUBPRG;        offset = 0
  when OCI_LTYPE_TYPE_ATTR;     offset = 1
  when OCI_LTYPE_TYPE_METHOD;   offset = 1
  when OCI_LTYPE_TYPE_ARG_PROC; offset = 0
  when OCI_LTYPE_TYPE_ARG_FUNC; offset = 1
  when OCI_LTYPE_SCH_OBJ;       offset = 0
  when OCI_LTYPE_DB_SCH;        offset = 0
  #when OCI_LTYPE_TYPE_SUBTYPE;  offset = ?
  #when OCI_LTYPE_TABLE_ALIAS;   offset = ?
  #when OCI_LTYPE_VARIABLE_TYPE; offset = ?
  #when OCI_LTYPE_NAME_VALUE;    offset = ?
  when 15; offset = 0 # OCI_LTYPE_PACKAGE_TYPE
  else
    raise NotImplementedError, "unsupported list type #{ltype}"
  end
  ary = []
  0.upto(num_params - 1) do |i|
    ary << __param_at(i + offset)
  end
  ary
end