summaryrefslogtreecommitdiff
path: root/doc/strscan/methods/get_byte.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/strscan/methods/get_byte.md')
-rw-r--r--doc/strscan/methods/get_byte.md7
1 files changed, 2 insertions, 5 deletions
diff --git a/doc/strscan/methods/get_byte.md b/doc/strscan/methods/get_byte.md
index 2f23be1899..775226638e 100644
--- a/doc/strscan/methods/get_byte.md
+++ b/doc/strscan/methods/get_byte.md
@@ -1,6 +1,3 @@
-call-seq:
- get_byte -> byte_as_character or nil
-
Returns the next byte, if available:
- If the [position][2]
@@ -10,7 +7,7 @@ Returns the next byte, if available:
- Increments the [byte position][2].
- Adjusts the [character position][7].
- ```
+ ```rb
scanner = StringScanner.new(HIRAGANA_TEXT)
# => #<StringScanner 0/15 @ "\xE3\x81\x93\xE3\x82...">
scanner.string # => "こんにちは"
@@ -24,7 +21,7 @@ Returns the next byte, if available:
- Otherwise, returns `nil`, and does not change the positions.
- ```
+ ```rb
scanner.terminate
[scanner.get_byte, scanner.pos, scanner.charpos] # => [nil, 15, 5]
```