diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2022-11-15 21:34:30 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-15 21:34:30 -0800 |
commit | e7443dbbcaf82eee200d33a5c3bc374ad9eec8a7 (patch) | |
tree | 876d854ae567dceb7f659fecc5ebe1c0ae421a62 /symbol.rb | |
parent | 41b0f641ef0671d8cde397e56b1eb3c6b8e0f0db (diff) |
Rewrite Symbol#to_sym and #intern in Ruby (#6683)
Notes
Notes:
Merged-By: k0kubun <takashikkbn@gmail.com>
Diffstat (limited to 'symbol.rb')
-rw-r--r-- | symbol.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/symbol.rb b/symbol.rb new file mode 100644 index 0000000000..0b23ebb267 --- /dev/null +++ b/symbol.rb @@ -0,0 +1,15 @@ +class Symbol + # call-seq: + # to_sym -> self + # + # Returns +self+. + # + # Symbol#intern is an alias for Symbol#to_sym. + # + # Related: String#to_sym. + def to_sym + self + end + + alias intern to_sym +end |