Class: OCI8::BindType::RAW

Inherits:
Object show all
Defined in:
lib/oci8/bindtype.rb

Direct Known Subclasses

LongRaw

Class Method Summary collapse

Class Method Details

.create(con, val, param, max_array_size) ⇒ Object



151
152
153
154
155
156
157
158
159
160
161
162
163
164
# File 'lib/oci8/bindtype.rb', line 151

def self.create(con, val, param, max_array_size)
  case param
  when Hash
    length = 400 # default length
    if param[:length]
      length = param[:length]
    elsif val.respond_to? :to_str and val.to_str.size > length
      length = val.to_str.size
    end
  when OCI8::Metadata::Base
    length = param.data_size
  end
  self.new(con, val, length, max_array_size)
end