summaryrefslogtreecommitdiff
path: root/doc/string/bytes.rdoc
diff options
context:
space:
mode:
authorBurdette Lamar <BurdetteLamar@Yahoo.com>2022-03-21 14:58:00 -0500
committerGitHub <noreply@github.com>2022-03-21 14:58:00 -0500
commitc129b6119dfb8d53521b986465c3a85e08d874fe (patch)
treecc22f0be21e0418239c5036be3c2e299241c77bd /doc/string/bytes.rdoc
parent1fd1f7bbfc5603cdcfa98363a9ec9e106705a0a3 (diff)
[DOC] Use RDoc inclusions in string.c (#5683)
As @peterzhu2118 and @duerst have pointed out, putting string method's RDoc into doc/ (which allows non-ASCII in examples) makes the "click to toggle source" feature not work for that method. This PR moves the primary method doc back into string.c, then includes RDoc from doc/string/*.rdoc, and also removes doc/string.rdoc. The affected methods are: ::new #bytes #each_byte #each_line #split The call-seq is in string.c because it works there; it did not work when the call-seq is in doc/string/*.rdoc. This PR also updates the relevant guidance in doc/documentation_guide.rdoc.
Notes
Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
Diffstat (limited to 'doc/string/bytes.rdoc')
-rw-r--r--doc/string/bytes.rdoc6
1 files changed, 6 insertions, 0 deletions
diff --git a/doc/string/bytes.rdoc b/doc/string/bytes.rdoc
new file mode 100644
index 0000000000..a9e89f1cd1
--- /dev/null
+++ b/doc/string/bytes.rdoc
@@ -0,0 +1,6 @@
+Returns an array of the bytes in +self+:
+
+ 'hello'.bytes # => [104, 101, 108, 108, 111]
+ 'тест'.bytes # => [209, 130, 208, 181, 209, 129, 209, 130]
+ 'こんにちは'.bytes
+ # => [227, 129, 147, 227, 130, 147, 227, 129, 171, 227, 129, 161, 227, 129, 175]