Class: PG::TextDecoder::Date
- Inherits:
-
SimpleDecoder
- Object
- SimpleDecoder
- PG::TextDecoder::Date
- Defined in:
- lib/pg/text_decoder.rb
Instance Method Summary collapse
Instance Method Details
#decode(string, tuple = nil, field = nil) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/pg/text_decoder.rb', line 10 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 |