as_json(*)
public
Returns a hash, that will be turned into a JSON
object and represent this object.
# File ext/json/lib/json/add/time.rb, line 21
def as_json(*)
nanoseconds = [ tv_usec * 1000 ]
respond_to?(:tv_nsec) and nanoseconds << tv_nsec
nanoseconds = nanoseconds.max
{
JSON.create_id => self.class.name,
's' => tv_sec,
'n' => nanoseconds,
}
end