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
Add sample code of Array#to_ary #719
Conversation
|
以下は雑なサンプルですけど、to_aと比較できる内容でセットで追加しちゃうのがいいかもしれません。
|
なるほど。確かにto_aとto_aryの違いが分かるほうがいいですよね。ありがとうございます。 |
上記アドバイスしていただいたサンプルを参考に、 |
refm/api/src/_builtin/Array
Outdated
@@ -1606,10 +1606,38 @@ sort_by の破壊的バージョンです。 | |||
self を返します。ただし、Array のサブクラスのインスタンスに対して呼ばれた時は、 | |||
自身を Array に変換したものを返します。 | |||
|
|||
例: | |||
|
|||
Class SubArray < Array; end |
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.
Class
→ 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.
class
ですね、ご指摘ありがとうございます。
refm/api/src/_builtin/Array
Outdated
--- to_ary -> self | ||
|
||
self をそのまま返します。 | ||
|
||
例: | ||
|
||
Class SubArray < Array; end |
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.
ここも。
@znz レビューしていただいてありがとうございますm(_ _)m
|
Thanks! |
#433