Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruby 2.7 で Time#inspect の出力が変わったので対応 #2493

Merged
merged 1 commit into from
Mar 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions refm/api/src/_builtin/Time
Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +896,25 @@ p t.strftime("%Y-%m-%d %H:%M:%S UTC") # => "2000-01-01 18:04:05 UTC"

戻り値の文字エンコーディングは [[m:Encoding::US_ASCII]] です。

#@since 2.7.0
--- inspect -> String

時刻を文字列に変換した結果を返します。

[[m:Time#to_s]] とは異なりナノ秒まで含めて返します。

#@samplecode
t = Time.now
t.inspect #=> "2012-11-10 18:16:12.261257655 +0100"
t.strftime "%Y-%m-%d %H:%M:%S.%N %z" #=> "2012-11-10 18:16:12.261257655 +0100"

t.utc.inspect #=> "2012-11-10 17:16:12.261257655 UTC"
t.strftime "%Y-%m-%d %H:%M:%S.%N UTC" #=> "2012-11-10 17:16:12.261257655 UTC"
#@end

戻り値の文字エンコーディングは [[m:Encoding::US_ASCII]] です。
#@end

--- hash -> Integer

self のハッシュ値を返します。
Expand Down