class Transit::WriteHandlers::TimeHandler

TimeHandler, DateTimeHandler, and DateHandler all have different implementations of string_rep. Here is the rationale:

For all three, want to write out the same format e.g. 2014-04-18T18:51:29.478Z, and we want the milliseconds to truncate rather than round, eg 29.4786 seconds should be 29.478, not 29.479.

Some data points (see benchmarks/encoding_time.rb)

Public Instance Methods

rep(t) click to toggle source
# File lib/transit/write_handlers.rb, line 292
def rep(t) DateTimeUtil.to_millis(t) end
string_rep(t) click to toggle source
# File lib/transit/write_handlers.rb, line 293
def string_rep(t) rep(t).to_s end
tag(_) click to toggle source
# File lib/transit/write_handlers.rb, line 291
def tag(_) "m" end
verbose_handler() click to toggle source
# File lib/transit/write_handlers.rb, line 294
def verbose_handler() VerboseTimeHandler.new end