src/ruby/lib/grpc/core/time_consts.rb
def from_relative_time(timeish)
        if timeish.is_a? TimeSpec
          timeish
        elsif timeish.nil?
          TimeConsts::ZERO
        elsif !timeish.is_a? Numeric
          fail(TypeError,
               "Cannot make an absolute deadline from #{timeish.inspect}")
        elsif timeish < 0
          TimeConsts::INFINITE_FUTURE
        elsif timeish.zero?
          TimeConsts::ZERO
        else
          Time.now + timeish
        end
      end
# Converts a time delta to an absolute deadline.
#
# Assumes timeish is a relative time, and converts its to an absolute,
# with following exceptions:
#
# * if timish is one of the TimeConsts.TimeSpec constants the value is
# preserved.
# * timish < 0 => TimeConsts.INFINITE_FUTURE
# * timish == 0 => TimeConsts.ZERO
#
# @param timeish [Number|TimeSpec]
# @return timeish [Number|TimeSpec]
Converts a time delta to an absolute deadline.
Assumes timeish is a relative time, and converts its to an absolute,
with following exceptions.

if timish is one of the TimeConsts.TimeSpec constants the value is
preserved.
timish < 0 => TimeConsts.INFINITE_FUTURE
timish == 0 => TimeConsts.ZERO
Converts a time delta to an absolute deadline . Assumes timeish is a relative time and converts its to an absolute with following exceptions . if timish is one of the TimeConsts . TimeSpec constants the value is preserved . timish < 0 = > TimeConsts . INFINITE_FUTURE timish == 0 = > TimeConsts . ZERO
def from_relative_time(timeish)
        if timeish.is_a? TimeSpec
          timeish
        elsif timeish.nil?
          TimeConsts::ZERO
        elsif !timeish.is_a? Numeric
          fail(TypeError,
               "Cannot make an absolute deadline from #{timeish.inspect}")
        elsif timeish < 0
          TimeConsts::INFINITE_FUTURE
        elsif timeish.zero?
          TimeConsts::ZERO
        else
          Time.now + timeish
        end
      end
def from_relative_time ( timeish ) if timeish . is_a? TimeSpec timeish elsif timeish . nil? TimeConsts :: ZERO elsif ! timeish . is_a? Numeric fail ( TypeError , "Cannot make an absolute deadline from #{timeish.inspect}" ) elsif timeish < 0 TimeConsts :: INFINITE_FUTURE elsif timeish . zero? TimeConsts :: ZERO else Time . now + timeish end end
Converts a time delta to an absolute deadline.
Converts a time delta to an absolute deadline .
None
Number|TimeSpec
timeish
None