Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions doc/stringio/getc.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ Returns +nil+ if at end-of-stream:

Returns characters, not bytes:

strio = StringIO.new('тест')
strio.getc # => "т"
strio.getc # => "е"
strio = StringIO.new('Привет')
strio.getc # => "П"
strio.getc # => "р"

strio = StringIO.new('こんにちは')
strio.getc # => "こ"
Expand All @@ -31,4 +31,4 @@ in other cases that need not be true:
strio.pos = 5 # => 5 # At third byte of second character; returns byte.
strio.getc # => "\x93"

Related: StringIO.getbyte.
Related: #each_char, #putc, #ungetc.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is getbyte removed from related methods?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is getbyte removed from related methods?

The Ruby doc guide suggests no more than three relateds (though of course that doc does not govern here). I thought the three other char methods more important than the byte method.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I didn't know the guide.

I think that #getbyte (similar), #ungetc (opposite) and #putc (opposite) are most related 3 methods because they focus on one operation like #getc does. #each_char (iterator variant) is less related than them because it focus on multiple targets.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Loading