Class: Droonga::MessagePackPacker::TimeFormatter
- Inherits:
-
Object
- Object
- Droonga::MessagePackPacker::TimeFormatter
- Defined in:
- lib/droonga/message-pack-packer/time-formatter.rb
Constant Summary collapse
- MICRO_SECONDS_DECIMAL_PLACE =
6
Class Method Summary collapse
Instance Method Summary collapse
- #format ⇒ Object
-
#initialize(time) ⇒ TimeFormatter
constructor
A new instance of TimeFormatter.
Constructor Details
#initialize(time) ⇒ TimeFormatter
Returns a new instance of TimeFormatter.
30 31 32 |
# File 'lib/droonga/message-pack-packer/time-formatter.rb', line 30 def initialize(time) @time = time end |
Class Method Details
.format(object) ⇒ Object
22 23 24 25 |
# File 'lib/droonga/message-pack-packer/time-formatter.rb', line 22 def format(object) formatter = new(object) formatter.format end |
Instance Method Details
#format ⇒ Object
34 35 36 |
# File 'lib/droonga/message-pack-packer/time-formatter.rb', line 34 def format @time.utc.iso8601(MICRO_SECONDS_DECIMAL_PLACE) end |