Class: PG::TextEncoder::Date

Inherits:
SimpleEncoder show all
Defined in:
lib/pg/text_encoder.rb

Constant Summary collapse

STRFTIME_ISO_DATE =
"%Y-%m-%d".freeze

Instance Method Summary collapse

Instance Method Details

#encode(value) ⇒ Object



7
8
9
# File 'lib/pg/text_encoder.rb', line 7

def encode(value)
	value.respond_to?(:strftime) ? value.strftime(STRFTIME_ISO_DATE) : value
end