mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
Use Primitive. in timev.rb for consistency with all other .rb files
This commit is contained in:
parent
8bcff5604b
commit
8d5f38a8a4
1 changed files with 6 additions and 6 deletions
12
timev.rb
12
timev.rb
|
@ -221,7 +221,7 @@ class Time
|
||||||
# Parameter:
|
# Parameter:
|
||||||
# :include: doc/time/in.rdoc
|
# :include: doc/time/in.rdoc
|
||||||
def self.now(in: nil)
|
def self.now(in: nil)
|
||||||
new(in: __builtin.arg!(:in))
|
new(in: Primitive.arg!(:in))
|
||||||
end
|
end
|
||||||
|
|
||||||
# _Time_
|
# _Time_
|
||||||
|
@ -268,7 +268,7 @@ class Time
|
||||||
# :include: doc/time/in.rdoc
|
# :include: doc/time/in.rdoc
|
||||||
#
|
#
|
||||||
def self.at(time, subsec = false, unit = :microsecond, in: nil)
|
def self.at(time, subsec = false, unit = :microsecond, in: nil)
|
||||||
__builtin.time_s_at(time, subsec, unit, __builtin.arg!(:in))
|
Primitive.time_s_at(time, subsec, unit, Primitive.arg!(:in))
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns a new \Time object based the on given arguments.
|
# Returns a new \Time object based the on given arguments.
|
||||||
|
@ -292,17 +292,17 @@ class Time
|
||||||
#
|
#
|
||||||
def initialize(year = (now = true), mon = nil, mday = nil, hour = nil, min = nil, sec = nil, zone = nil, in: nil)
|
def initialize(year = (now = true), mon = nil, mday = nil, hour = nil, min = nil, sec = nil, zone = nil, in: nil)
|
||||||
if zone
|
if zone
|
||||||
if __builtin.arg!(:in)
|
if Primitive.arg!(:in)
|
||||||
raise ArgumentError, "timezone argument given as positional and keyword arguments"
|
raise ArgumentError, "timezone argument given as positional and keyword arguments"
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
zone = __builtin.arg!(:in)
|
zone = Primitive.arg!(:in)
|
||||||
end
|
end
|
||||||
|
|
||||||
if now
|
if now
|
||||||
return __builtin.time_init_now(zone)
|
return Primitive.time_init_now(zone)
|
||||||
end
|
end
|
||||||
|
|
||||||
__builtin.time_init_args(year, mon, mday, hour, min, sec, zone)
|
Primitive.time_init_args(year, mon, mday, hour, min, sec, zone)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue