Class: Sequel::Postgres::PGArray::Creator
- Defined in:
- lib/sequel/extensions/pg_array.rb
Overview
Callable object that takes the input string and parses it using Parser.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#converter ⇒ Object
readonly
The converter callable that is called on each member of the array to convert it to the correct type.
-
#type ⇒ Object
readonly
The database type to set on the PGArray instances returned.
Instance Method Summary collapse
-
#call(string) ⇒ Object
Parse the string using Parser with the appropriate converter, and return a PGArray with the appropriate database type.
-
#initialize(type, converter = nil) ⇒ Creator
constructor
Set the type and optional converter callable that will be used.
Constructor Details
#initialize(type, converter = nil) ⇒ Creator
Set the type and optional converter callable that will be used.
441 442 443 444 |
# File 'lib/sequel/extensions/pg_array.rb', line 441 def initialize(type, converter=nil) @type = type @converter = converter end |
Instance Attribute Details
#converter ⇒ Object (readonly)
The converter callable that is called on each member of the array to convert it to the correct type.
435 436 437 |
# File 'lib/sequel/extensions/pg_array.rb', line 435 def converter @converter end |
#type ⇒ Object (readonly)
The database type to set on the PGArray instances returned.
438 439 440 |
# File 'lib/sequel/extensions/pg_array.rb', line 438 def type @type end |