[前][次][番号順一覧][スレッド一覧]

ruby-changes:53204

From: nobu <ko1@a...>
Date: Sun, 28 Oct 2018 21:05:22 +0900 (JST)
Subject: [ruby-changes:53204] nobu:r65419 (trunk): time.c: [DOC] add description and fix markups [ci skip]

nobu	2018-10-28 21:05:17 +0900 (Sun, 28 Oct 2018)

  New Revision: 65419

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65419

  Log:
    time.c: [DOC] add description and fix markups [ci skip]

  Modified files:
    trunk/time.c
Index: time.c
===================================================================
--- time.c	(revision 65418)
+++ time.c	(revision 65419)
@@ -5285,18 +5285,25 @@ rb_time_zone_abbreviation(VALUE zone, VA https://github.com/ruby/ruby/blob/trunk/time.c#L5285
  *
  *  == Timezone argument
  *
- *  A timezone argument must have #local_to_utc, #utc_to_local, #name methods,
- *  and may have #abbr method.
+ *  A timezone argument must have +local_to_utc+ and +utc_to_local+
+ *  methods, and may have +name+ and +abbr+ methods.
  *
- *  The +#local_to_utc+ method should convert a Time-like object from the
- *  timezone to UTC, and +#utc_to_local+ is the opposite.  The Time-like
- *  argument to these methods is similar to a Time object in UTC without
- *  sub-second; it has attribute readers for the parts, and #to_i.  The
- *  sub-second attributes are fixed as 0, and #utc_offset, #zone, #isdst, and
- *  the aliases are same as a Time object in UTC.
+ *  The +local_to_utc+ method should convert a Time-like object from
+ *  the timezone to UTC, and +utc_to_local+ is the opposite.  The
+ *  result also should be a Time or Time-like object (not necessary to
+ *  be the same class).  The #zone of the result is just ignored.
+ *  Time-like argument to these methods is similar to a Time object in
+ *  UTC without sub-second; it has attribute readers for the parts,
+ *  e.g. #year, #month, and so on, and epoch time readers, #to_i.  The
+ *  sub-second attributes are fixed as 0, and #utc_offset, #zone,
+ *  #isdst, and their aliases are same as a Time object in UTC.
+ *  Also #to_time method is defined.
  *
- *  The #name method is used for marshaling, and the #abbr method is used by
- *  '%Z' in #strftime.
+ *  The +name+ method is used for marshaling. If this method is not
+ *  defined on a timezone object, Time objects using that timezone
+ *  object are not able to dump by Marshal.
+ *
+ *  The +abbr+ method is used by '%Z' in #strftime.
  */
 
 void

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]