Sha256: c287c750bafea3ebea3a1e1ad7cd1ce75e1f479f7fdf4c1d08455e5ce4879153

Contents?: true

Size: 1.81 KB

Versions: 12

Compression:

Stored size: 1.81 KB

Contents

o:$YARD::CodeObjects::MethodObject:@scope:
instance:@visibility:public:
@pathI"Time#to_r:EF:@parameters[:@files[[I"time.c;T0:@current_file_has_commentsF:
@name:	to_r:@source_type:c:
@tags[:@docstringIC:YARD::Docstring"9Returns the value of <i>time</i> as a rational number of seconds
since the Epoch.

   t = Time.now
   p t.to_r            #=> (1270968792716287611/1000000000)

This methods is intended to be used to get an accurate value
representing nanoseconds from the Epoch.  You can use this
to convert time to another Epoch.;F:@objectIu:YARD::StubProxyTime#to_r;F:
@summary0:@ref_tags[;[o:YARD::Tags::OverloadTag
:@tag_nameI"
overload;F:
@text0;;:@types0:@signatureI"	to_r;F;IC;";F;Iu;Time#to_r;F;0;[;[:	@allI";F;[;Iu;Time#to_r;F;I"JReturns the value of <i>time</i> as a rational number of seconds
since the Epoch.

   t = Time.now
   p t.to_r            #=> (1270968792716287611/1000000000)

This methods is intended to be used to get an accurate value
representing nanoseconds from the Epoch.  You can use this
to convert time to another Epoch.


@overload to_r;F:@namespaceIu;	Time;F:@docstring_extra0:@sourceI"/*
 *  call-seq:
 *     time.to_r -> a_rational
 *
 *  Returns the value of <i>time</i> as a rational number of seconds
 *  since the Epoch.
 *
 *     t = Time.now
 *     p t.to_r            #=> (1270968792716287611/1000000000)
 *
 *  This methods is intended to be used to get an accurate value
 *  representing nanoseconds from the Epoch.  You can use this
 *  to convert time to another Epoch.
 */

static VALUE
time_to_r(VALUE time)
{
    struct time_object *tobj;
    VALUE v;

    GetTimeval(time, tobj);
    v = w2v(rb_time_unmagnify(tobj->timew));
    if (TYPE(v) != T_RATIONAL) {
        v = rb_Rational1(v);
    }
    return v;
};F

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
pry-doc-0.4.4 lib/pry-doc/core_docs_19/objects/Time/to_r_i.dat
pry-doc-0.4.3 lib/pry-doc/core_docs_19/objects/Time/to_r_i.dat
pry-doc-0.4.2 lib/pry-doc/core_docs_19/objects/Time/to_r_i.dat
pry-doc-0.4.1 lib/pry-doc/core_docs_19/objects/Time/to_r_i.dat
pry-doc-0.4.0 lib/pry-doc/core_docs_19/objects/Time/to_r_i.dat
pry-doc-0.3.0 lib/pry-doc/core_docs_19/objects/Time/to_r_i.dat
pry-doc-0.2.4pre1 lib/pry-doc/core_docs_19/objects/Time/to_r_i.dat
pry-doc-0.2.3pre1 lib/pry-doc/core_docs_19/objects/Time/to_r_i.dat
pry-doc-0.2.1 lib/pry-doc/core_docs_19/objects/Time/to_r_i.dat
pry-doc-0.2.0 lib/pry-doc/core_docs_19/objects/Time/to_r_i.dat
pry-doc-0.1.5pre1 lib/pry-doc/core_docs_19/objects/Time/to_r_i.dat
pry-0.6.9pre1-i386-mingw32 lib/pry/core_docs_19/objects/Time/to_r_i.dat