diff options
author | Koichi Sasada <ko1@atdot.net> | 2021-11-13 07:44:46 +0900 |
---|---|---|
committer | Koichi Sasada <ko1@atdot.net> | 2021-11-15 15:58:56 +0900 |
commit | 2a3d5d661ce2cadad50aa5d72b54e134da54f5f3 (patch) | |
tree | 2b20bf1f12d64ec7076106fa5039bdd4d6aef96d /timev.rb | |
parent | dde010c97432de8ac2336eeeb4f6b99daf832b61 (diff) |
Use `Primitive.mandatory_only?` for `Time.at`
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/5112
Diffstat (limited to 'timev.rb')
-rw-r--r-- | timev.rb | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -268,7 +268,11 @@ class Time # :include: doc/time/in.rdoc # def self.at(time, subsec = false, unit = :microsecond, in: nil) - Primitive.time_s_at(time, subsec, unit, Primitive.arg!(:in)) + if Primitive.mandatory_only? + Primitive.time_s_at1(time) + else + Primitive.time_s_at(time, subsec, unit, Primitive.arg!(:in)) + end end # Returns a new \Time object based the on given arguments. |