Method: Time#eql?

Defined in:
time.c

#eql?(other_time) ⇒ Boolean

Returns true if self and other_time are both Time objects with the exact same time value.

Returns:

  • (Boolean)


3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
# File 'time.c', line 3988

static VALUE
time_eql(VALUE time1, VALUE time2)
{
    struct time_object *tobj1, *tobj2;

    GetTimeval(time1, tobj1);
    if (IsTimeval(time2)) {
        GetTimeval(time2, tobj2);
        return rb_equal(w2v(tobj1->timew), w2v(tobj2->timew));
    }
    return Qfalse;
}