Class: Sequel::Postgres::PGMultiRange::Creator
- Defined in:
- lib/sequel/extensions/pg_multirange.rb
Overview
Callable object that takes the input string and parses it using Parser.
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
The database type to set on the PGMultiRange instances returned.
Instance Method Summary collapse
-
#call(string) ⇒ Object
Parse the string using Parser with the appropriate converter, and return a PGMultiRange with the appropriate database type.
-
#initialize(type, converter = nil) ⇒ Creator
constructor
A new instance of Creator.
Constructor Details
permalink #initialize(type, converter = nil) ⇒ Creator
Returns a new instance of Creator.
98 99 100 101 |
# File 'lib/sequel/extensions/pg_multirange.rb', line 98 def initialize(type, converter=nil) @type = type @converter = converter end |
Instance Attribute Details
Instance Method Details
permalink #call(string) ⇒ Object
Parse the string using Parser with the appropriate converter, and return a PGMultiRange with the appropriate database type.
106 107 108 |
# File 'lib/sequel/extensions/pg_multirange.rb', line 106 def call(string) PGMultiRange.new(Parser.new(string, @converter).parse, @type) end |