Class: DB::Postgres::Native::Strings

Inherits:
Object
  • Object
show all
Defined in:
lib/db/postgres/native/connection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(values) ⇒ Strings

Returns a new instance of Strings.


29
30
31
32
33
34
35
# File 'lib/db/postgres/native/connection.rb', line 29

def initialize(values)
	@array = FFI::MemoryPointer.new(:pointer, values.size + 1)
	@pointers = values.map do |value|
		FFI::MemoryPointer.from_string(value.to_s)
	end
	@array.write_array_of_pointer(@pointers)
end

Instance Attribute Details

#arrayObject (readonly)

Returns the value of attribute array


37
38
39
# File 'lib/db/postgres/native/connection.rb', line 37

def array
  @array
end