Class Sequel::Postgres::PGArray::Creator
In: lib/sequel/extensions/pg_array.rb
Parent: Object

Callable object that takes the input string and parses it using Parser.

Methods

call   call   new  

Attributes

converter  [R]  The converter callable that is called on each member of the array to convert it to the correct type.
type  [R]  The database type to set on the PGArray instances returned.

Public Class methods

Set the type and optional converter callable that will be used.

[Source]

     # File lib/sequel/extensions/pg_array.rb, line 390
390:         def initialize(type, converter=nil)
391:           @type = type
392:           @converter = converter
393:         end

Public Instance methods

Parse the string using Parser with the appropriate converter, and return a PGArray with the appropriate database type.

[Source]

     # File lib/sequel/extensions/pg_array.rb, line 406
406:           def call(string)
407:             PGArray.new(Parser.new(string, @converter).parse, @type)
408:           end

:nocov: Use sequel_pg‘s C-based parser if it has already been defined.

[Source]

     # File lib/sequel/extensions/pg_array.rb, line 398
398:           def call(string)
399:             PGArray.new(Sequel::Postgres.parse_pg_array(string, @converter), @type)
400:           end

[Validate]