# class PG::BasicTypeMapForResults::WarningTypeMap

### Public Class Methods

new(typenames) click to toggle source

    # File lib/pg/basic_type_mapping.rb, line 307
    def initialize(typenames)
            @already_warned = Hash.new{|h, k| h[k] = {} }
            @typenames_by_oid = typenames
    end

### Public Instance Methods

typecast_result_value(result, _tuple, field) click to toggle source
Calls superclass method `PG::TypeMapInRuby#typecast_result_value`

    # File lib/pg/basic_type_mapping.rb, line 312
    def typecast_result_value(result, _tuple, field)
            format = result.fformat(field)
            oid = result.ftype(field)
            unless @already_warned[format][oid]
                    $stderr.puts "Warning: no type cast defined for type #{@typenames_by_oid[format][oid].inspect} with oid #{oid}. Please cast this type explicitly to TEXT to be safe for future changes."
                     @already_warned[format][oid] = true
            end
            super
    end