-
Notifications
You must be signed in to change notification settings - Fork 319
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
Random::DEFAULT is deprecated since 3.0.0 #2487
Merged
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
00aaffa
Random::DEFAULT is deprecated since 3.0.0
ima1zumi 32ae566
非推奨になったことを2.x系でも表示するようにした
ima1zumi 9ec9896
Random::DEFAULT に関するリンクを修正
ima1zumi 78df158
Random::DEFAULT return Random Class Object since 3.0.0
ima1zumi b5a1b99
Fix link and message
ima1zumi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -353,9 +353,21 @@ C言語レベルで定義されている構造体MTの静的変数default_rand | |
|
||
--- DEFAULT -> Random | ||
|
||
#@since 3.0.0 | ||
Ruby 3.0.0 から非推奨です。代わりに Random クラスオブジェクトを使ってください。 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. #2118 サンプルコードなど詳細な説明は3.0から表示しつつ、非表示になった事実は2.xでも表示すると良いのかなと思っています |
||
|
||
また、 Random::DEFAULT は Random クラスオブジェクトが返ります。 | ||
|
||
#@samplecode | ||
Random::DEFAULT == Random # => true | ||
Random.rand(10) # => 4 | ||
#@end | ||
|
||
#@else | ||
デフォルトの疑似乱数生成器です。 | ||
[[m:Random.rand]] や [[m:Kernel.#rand]] などで使用されます。 | ||
|
||
@see [[m:Random.srand]], [[m:Kernel.#srand]] | ||
#@end | ||
#@end | ||
#@end |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
この行も3.0からは変更したほうが良さそうです。 ただ、"Random クラスオブジェクト" を書く方法があるのかちょっとわかりませんでした…。
-> Class
と書いて文章で補足するのが良いかな🤔よい記法を知っていたら誰か教えてほしいです
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
78df158 で
-> Class
に修正しました。クラスオブジェクトを書く方法は見つけられなかったです 😓