Class: ODPI::BindType::String

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

Constant Summary collapse

TYPES =
[:varchar, :bytes]

Instance Attribute Summary

Attributes inherited from Base

#raw_var

Instance Method Summary collapse

Methods inherited from Base

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

Constructor Details

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

Returns a new instance of String.


314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
# File 'lib/odpi/bindtype.rb', line 314

def initialize(conn, value, type, params, array_size, is_array)
  if params.is_a? Hash
    size = params[:length]
    if size.nil?
      if is_array
        size = value.collect(&:size).max
      else
        size = value.size
      end
    end
  else
    size = params.size_in_chars
  end
  super(conn, array_size, size, true, is_array, nil)
end