Class: ODPI::BindType::Object

Inherits:
Base
  • Object
show all
Defined in:
lib/odpi/bindtype.rb

Constant Summary collapse

TYPES =
[:object, :object]

Instance Attribute Summary

Attributes inherited from Base

#raw_var

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#[], #[]=, #get, #set, to_bindclass

Constructor Details

#initialize(conn, value, type, params, array_size, is_array) ⇒ Object

Returns a new instance of Object.


333
334
335
336
337
338
339
340
# File 'lib/odpi/bindtype.rb', line 333

def initialize(conn, value, type, params, array_size, is_array)
  if type.is_a?(Class) && type < ODPI::Object::Base
    objtype = conn.object_type(ODPI::Object.find_name_by_class(type))
  else
    objtype = params.object_type
  end
  super(conn, array_size, 0, nil, is_array, objtype)
end

Class Method Details

.convert_in(conn, val) ⇒ Object


342
343
344
# File 'lib/odpi/bindtype.rb', line 342

def self.convert_in(conn, val)
  val.__object__
end

.convert_out(conn, val) ⇒ Object


346
347
348
349
350
# File 'lib/odpi/bindtype.rb', line 346

def self.convert_out(conn, val)
  objtype = val.object_type
  klass = ODPI::Object.find_class(objtype.schema, objtype.name)
  klass.new(conn, objtype, val)
end