mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Shrink timev.rb iseq size
This commit is contained in:
parent
86b4c2fc3f
commit
30d2d72663
1 changed files with 59 additions and 59 deletions
6
timev.rb
6
timev.rb
|
@ -1,3 +1,4 @@
|
|||
class Time
|
||||
# Creates a new \Time object from the current system time.
|
||||
# This is the same as Time.new without arguments.
|
||||
#
|
||||
|
@ -6,7 +7,7 @@
|
|||
#
|
||||
# Parameter:
|
||||
# :include: doc/time/in.rdoc
|
||||
def Time.now(in: nil)
|
||||
def self.now(in: nil)
|
||||
new(in: __builtin.arg!(:in))
|
||||
end
|
||||
|
||||
|
@ -53,11 +54,10 @@ end
|
|||
# :include: doc/time/nsec.rdoc
|
||||
# :include: doc/time/in.rdoc
|
||||
#
|
||||
def Time.at(time, subsec = (nosubsec = true), unit = (nounit = true), in: nil)
|
||||
def self.at(time, subsec = (nosubsec = true), unit = (nounit = true), in: nil)
|
||||
__builtin.time_s_at(time, subsec, unit, __builtin.arg!(:in), nosubsec, nounit)
|
||||
end
|
||||
|
||||
class Time
|
||||
# Returns a new \Time object based the on given arguments.
|
||||
#
|
||||
# With no positional arguments, returns the value of Time.now:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue