Class: PG::TextEncoder::TimestampWithoutTimeZone
- Inherits:
-
SimpleEncoder
- Object
- Coder
- SimpleCoder
- SimpleEncoder
- PG::TextEncoder::TimestampWithoutTimeZone
- Defined in:
- lib/pg/text_encoder.rb
Constant Summary collapse
- STRFTIME_ISO_DATETIME_WITHOUT_TIMEZONE =
"%Y-%m-%d %H:%M:%S.%N".freeze
Constants inherited from Coder
Coder::FORMAT_ERROR_MASK, Coder::FORMAT_ERROR_TO_PARTIAL, Coder::FORMAT_ERROR_TO_RAISE, Coder::FORMAT_ERROR_TO_STRING, Coder::TIMESTAMP_APP_LOCAL, Coder::TIMESTAMP_APP_UTC, Coder::TIMESTAMP_DB_LOCAL, Coder::TIMESTAMP_DB_UTC
Instance Attribute Summary
Attributes inherited from Coder
Instance Method Summary collapse
Methods inherited from Coder
#==, #decode, #dup, #flags, #flags=, #format, #format=, #initialize, #inspect, #marshal_dump, #marshal_load, #oid, #oid=, #to_h
Constructor Details
This class inherits a constructor from PG::Coder
Instance Method Details
#encode(value) ⇒ Object
17 18 19 |
# File 'lib/pg/text_encoder.rb', line 17 def encode(value) value.respond_to?(:strftime) ? value.strftime(STRFTIME_ISO_DATETIME_WITHOUT_TIMEZONE) : value end |