Class: OCI8::BindType::RAW

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

Direct Known Subclasses

LongRaw

Class Method Summary (collapse)

Class Method Details

+ (Object) create(con, val, param, max_array_size)



163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# File 'lib/oci8/bindtype.rb', line 163

def self.create(con, val, param, max_array_size)
  case param
  when Hash
    unless param[:length]
      if val.respond_to? :to_str
        val = val.to_str
        if val.respond_to? :bytesize
          param[:length] = val.bytesize
        else
          param[:length] = val.size
        end
      else
        param[:length] = 400
      end
    end
  when OCI8::Metadata::Base
    param = {:length => param.data_size}
  end
  self.new(con, val, param, max_array_size)
end