Class: DB::Postgres::Native::Strings
- Inherits:
-
Object
- Object
- DB::Postgres::Native::Strings
- Defined in:
- lib/db/postgres/native/connection.rb
Instance Attribute Summary collapse
-
#array ⇒ Object
readonly
Returns the value of attribute array.
Instance Method Summary collapse
-
#initialize(values) ⇒ Strings
constructor
A new instance of Strings.
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
#array ⇒ Object (readonly)
Returns the value of attribute array.
37 38 39 |
# File 'lib/db/postgres/native/connection.rb', line 37 def array @array end |