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 396
396:         def initialize(type, converter=nil)
397:           @type = type
398:           @converter = converter
399:         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 410
410:           def call(string)
411:             PGArray.new(Parser.new(string, @converter).parse, @type)
412:           end

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

[Source]

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

[Validate]