PG::TextDecoder::

Date

class
Superclass
PG::SimpleDecoder

Public Instance Methods

anchor
decode(string, tuple=nil, field=nil)
# File lib/pg/text_decoder.rb, line 9
def decode(string, tuple=nil, field=nil)
        if string =~ /\A(\d{4})-(\d\d)-(\d\d)\z/
                ::Date.new $1.to_i, $2.to_i, $3.to_i
        else
                string
        end
end