diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2024-01-31 07:47:35 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-31 10:47:35 -0500 |
commit | 51753ec7fa82fb5c3f7ef3c5766b0e84c47d3d21 (patch) | |
tree | c1f71e8039dac2dfc52280e2af7fb7c1fbf097f8 /symbol.rb | |
parent | a322b2faa40959ffdbe6da077c778131cb1c894f (diff) |
Annotate Symbol#to_s as leaf (#9769)
Diffstat (limited to 'symbol.rb')
-rw-r--r-- | symbol.rb | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -1,5 +1,20 @@ class Symbol # call-seq: + # to_s -> string + # + # Returns a string representation of +self+ (not including the leading colon): + # + # :foo.to_s # => "foo" + # + # Related: Symbol#inspect, Symbol#name. + def to_s + Primitive.attr! :leaf + Primitive.cexpr! 'rb_sym_to_s(self)' + end + + alias id2name to_s + + # call-seq: # to_sym -> self # # Returns +self+. |