Define a private range typecasting method for the given type that uses the parser argument to do the type conversion.
# File lib/sequel/extensions/pg_range.rb, line 193 def self.define_range_typecast_method(type, parser) meth = :"typecast_value_#{type}" define_method(meth){|v| typecast_value_pg_range(v, parser)} private meth end
Reset the conversion procs if using the native postgres adapter, and extend the datasets to correctly literalize ruby Range values.
# File lib/sequel/extensions/pg_range.rb, line 187 def self.extended(db) db.extend_datasets(DatasetMethods) end